mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 08:21:15 +03:00
Fixed user/:id/teams access control
This commit is contained in:
parent
5db7383a38
commit
c42f8f98a4
@ -1006,7 +1006,7 @@ class UserTeamsList(ListAPIView):
|
|||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
u = User.objects.get(pk=self.kwargs['pk'])
|
u = User.objects.get(pk=self.kwargs['pk'])
|
||||||
if not u.can_access(User, 'read', self.request.user):
|
if not self.request.user.can_access(User, 'read', u):
|
||||||
raise PermissionDenied()
|
raise PermissionDenied()
|
||||||
return Team.accessible_objects(self.request.user, {'read': True}).filter(member_role__members=u)
|
return Team.accessible_objects(self.request.user, {'read': True}).filter(member_role__members=u)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user