mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 02:50:02 -03:30
Filter out roles users shouldn't be able to see from parents/children lists
This commit is contained in:
parent
80b044580d
commit
d3476ed52a
@ -3742,10 +3742,9 @@ class RoleParentsList(SubListAPIView):
|
||||
new_in_300 = True
|
||||
|
||||
def get_queryset(self):
|
||||
# XXX: This should be the intersection between the roles of the user
|
||||
# and the roles that the requesting user has access to see
|
||||
role = Role.objects.get(pk=self.kwargs['pk'])
|
||||
return role.parents.all()
|
||||
return Role.filter_visible_roles(self.request.user, role.parents.all())
|
||||
|
||||
|
||||
class RoleChildrenList(SubListAPIView):
|
||||
|
||||
@ -3757,10 +3756,8 @@ class RoleChildrenList(SubListAPIView):
|
||||
new_in_300 = True
|
||||
|
||||
def get_queryset(self):
|
||||
# XXX: This should be the intersection between the roles of the user
|
||||
# and the roles that the requesting user has access to see
|
||||
role = Role.objects.get(pk=self.kwargs['pk'])
|
||||
return role.children.all()
|
||||
return Role.filter_visible_roles(self.request.user, role.children.all())
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user