mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 06:17:36 -02:30
RoleAccess.can_unattach ensures you have read access member
This commit is contained in:
@@ -1598,6 +1598,10 @@ class RoleAccess(BaseAccess):
|
|||||||
|
|
||||||
@check_superuser
|
@check_superuser
|
||||||
def can_unattach(self, obj, sub_obj, relationship):
|
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 \
|
if obj.object_id and \
|
||||||
isinstance(obj.content_object, ResourceMixin) and \
|
isinstance(obj.content_object, ResourceMixin) and \
|
||||||
self.user in obj.content_object.admin_role:
|
self.user in obj.content_object.admin_role:
|
||||||
|
|||||||
Reference in New Issue
Block a user