mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02: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:
|
if obj.is_superuser and super_users.count() == 1:
|
||||||
# cannot delete the last active superuser
|
# cannot delete the last active superuser
|
||||||
return False
|
return False
|
||||||
if self.user.is_superuser:
|
if self.can_admin(obj, None, allow_orphans=True):
|
||||||
return True
|
|
||||||
if self.can_admin(obj, None):
|
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user