mirror of
https://github.com/ansible/awx.git
synced 2026-01-19 13:41:28 -03:30
RoleAccess.can_unattach ensures you have read access member
This commit is contained in:
parent
87ffded774
commit
089065bed1
@ -1598,6 +1598,10 @@ class RoleAccess(BaseAccess):
|
||||
|
||||
@check_superuser
|
||||
def can_unattach(self, obj, sub_obj, relationship):
|
||||
if relationship == 'members':
|
||||
if not check_user_access(self.user, sub_obj.__class__, 'read', sub_obj):
|
||||
return False
|
||||
|
||||
if obj.object_id and \
|
||||
isinstance(obj.content_object, ResourceMixin) and \
|
||||
self.user in obj.content_object.admin_role:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user