1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +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:
Rebeccah 2019-09-27 12:26:00 -04:00
parent 69924c9544
commit 075d1a2521

View File

@ -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