mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-14 01:28:36 -05:00
AC-711 Allow org admins to see all users.
This commit is contained in:
+4
-1
@@ -156,7 +156,8 @@ class UserAccess(BaseAccess):
|
||||
I can see user records when:
|
||||
- I'm a superuser.
|
||||
- I'm that user.
|
||||
- I'm their org admin.
|
||||
- I'm an org admin (org admins should be able to see all users, in order
|
||||
to add those users to the org).
|
||||
- I'm in an org with that user.
|
||||
- I'm on a team with that user.
|
||||
I can change some fields for a user (mainly password) when I am that user.
|
||||
@@ -171,6 +172,8 @@ class UserAccess(BaseAccess):
|
||||
qs = self.model.objects.filter(is_active=True).distinct()
|
||||
if self.user.is_superuser:
|
||||
return qs
|
||||
if self.user.admin_of_organizations.count():
|
||||
return qs
|
||||
return qs.filter(
|
||||
Q(pk=self.user.pk) |
|
||||
Q(organizations__in=self.user.admin_of_organizations.all()) |
|
||||
|
||||
Reference in New Issue
Block a user