1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

Fixed user/:id/teams access control

This commit is contained in:
Akita Noek 2016-03-22 14:05:53 -04:00
parent 5db7383a38
commit c42f8f98a4

View File

@ -1006,7 +1006,7 @@ class UserTeamsList(ListAPIView):
def get_queryset(self):
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()
return Team.accessible_objects(self.request.user, {'read': True}).filter(member_role__members=u)