mirror of
https://github.com/ansible/awx.git
synced 2026-02-16 18:50:04 -03:30
A user can access what teams they are on.
This commit is contained in:
@@ -110,7 +110,7 @@ class UserHelper(object):
|
||||
return 'partial'
|
||||
if user.is_superuser:
|
||||
return True
|
||||
matching_orgs = len(set(obj.organizations.all()) & set(user.admin_of_organizations.all()))
|
||||
matching_orgs = obj.organizations.filter(admins__in = [user]).count()
|
||||
return matching_orgs
|
||||
|
||||
@classmethod
|
||||
@@ -123,7 +123,7 @@ class UserHelper(object):
|
||||
def can_user_delete(cls, user, obj):
|
||||
if user.is_superuser:
|
||||
return True
|
||||
matching_orgs = len(set(obj.organizations.all()) & set(user.admin_of_organizations.all()))
|
||||
matching_orgs = obj.organizations.filter(admins__in = [user]).count()
|
||||
return matching_orgs
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user