mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 15:09:32 -02:30
Allow string "false" to mean False on is_superuser
This commit is contained in:
@@ -444,7 +444,8 @@ def disallow_superuser_escalation(cls):
|
||||
@functools.wraps(method)
|
||||
def fx(self, request, *a, **kw):
|
||||
if not request.user.is_superuser:
|
||||
if request.DATA.get('is_superuser', False):
|
||||
is_su = request.DATA.get('is_superuser', False)
|
||||
if su and su != 'false':
|
||||
raise PermissionDenied('Only superusers may create '
|
||||
'other superusers.')
|
||||
return method(self, request, *a, **kw)
|
||||
|
||||
Reference in New Issue
Block a user