mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 04:10:44 -03:30
Merge pull request #1783 from anoek/1713
Special case handling for team access list to prevent "read" role shwing up as a direct team role
This commit is contained in:
commit
7e445124a4
@ -1546,6 +1546,15 @@ class ResourceAccessListElementSerializer(UserSerializer):
|
||||
.filter(content_type=team_content_type,
|
||||
members=user,
|
||||
children__in=direct_permissive_role_ids)
|
||||
if content_type == team_content_type:
|
||||
# When looking at the access list for a team, exclude the entries
|
||||
# for that team. This exists primarily so we don't list the read role
|
||||
# as a direct role when a user is a member or admin of a team
|
||||
direct_team_roles = direct_team_roles.exclude(
|
||||
children__content_type=team_content_type,
|
||||
children__object_id=obj.id
|
||||
)
|
||||
|
||||
|
||||
indirect_team_roles = Role.objects \
|
||||
.filter(content_type=team_content_type,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user