mirror of
https://github.com/ansible/awx.git
synced 2026-03-29 06:45:09 -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)
|
@functools.wraps(method)
|
||||||
def fx(self, request, *a, **kw):
|
def fx(self, request, *a, **kw):
|
||||||
if not request.user.is_superuser:
|
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 '
|
raise PermissionDenied('Only superusers may create '
|
||||||
'other superusers.')
|
'other superusers.')
|
||||||
return method(self, request, *a, **kw)
|
return method(self, request, *a, **kw)
|
||||||
|
|||||||
Reference in New Issue
Block a user