mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 16:51:11 +03:00
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:
parent
69924c9544
commit
075d1a2521
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user