mirror of
https://github.com/ansible/awx.git
synced 2026-03-03 09:48:51 -03:30
removed superuser check since can_admin already checks that, and also added allow orphans so admins can delete orphaned users
This commit is contained in:
@@ -661,9 +661,7 @@ class UserAccess(BaseAccess):
|
||||
if obj.is_superuser and super_users.count() == 1:
|
||||
# cannot delete the last active superuser
|
||||
return False
|
||||
if self.user.is_superuser:
|
||||
return True
|
||||
if self.can_admin(obj, None):
|
||||
if self.can_admin(obj, None, allow_orphans=True):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user