mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 11:50:42 -03:30
Merge pull request #2675 from wwitzel3/issue-2244
Do not show the read_role child for Teams
This commit is contained in:
commit
4f534122c5
@ -867,7 +867,7 @@ class TeamRolesList(SubListCreateAttachDetachAPIView):
|
||||
team = get_object_or_404(Team, pk=self.kwargs['pk'])
|
||||
if not self.request.user.can_access(Team, 'read', team):
|
||||
raise PermissionDenied()
|
||||
return Role.filter_visible_roles(self.request.user, team.member_role.children.all())
|
||||
return Role.filter_visible_roles(self.request.user, team.member_role.children.all().exclude(pk=team.read_role.pk))
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
# Forbid implicit role creation here
|
||||
|
||||
@ -183,7 +183,7 @@ def test_get_teams_roles_list(get, team, organization, admin):
|
||||
assert response.status_code == 200
|
||||
roles = response.data
|
||||
|
||||
assert roles['count'] == 2
|
||||
assert roles['count'] == 1
|
||||
assert roles['results'][0]['id'] == organization.admin_role.id or roles['results'][1]['id'] == organization.admin_role.id
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user