mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 01:21:21 +03:00
Protect team assignment for the roles access point
This commit is contained in:
parent
eb3b518507
commit
771108e298
@ -2483,6 +2483,10 @@ class RoleAccess(BaseAccess):
|
|||||||
|
|
||||||
@check_superuser
|
@check_superuser
|
||||||
def can_unattach(self, obj, sub_obj, relationship, data=None, skip_sub_obj_read_check=False):
|
def can_unattach(self, obj, sub_obj, relationship, data=None, skip_sub_obj_read_check=False):
|
||||||
|
if isinstance(obj.content_object, Team):
|
||||||
|
if not settings.ORGS_CAN_ASSIGN_USERS_TEAM:
|
||||||
|
return False
|
||||||
|
|
||||||
if not skip_sub_obj_read_check and relationship in ['members', 'member_role.parents', 'parents']:
|
if not skip_sub_obj_read_check and relationship in ['members', 'member_role.parents', 'parents']:
|
||||||
# If we are unattaching a team Role, check the Team read access
|
# If we are unattaching a team Role, check the Team read access
|
||||||
if relationship == 'parents':
|
if relationship == 'parents':
|
||||||
|
Loading…
Reference in New Issue
Block a user