mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 15:09:32 -02:30
Allow more falsy values.
This commit is contained in:
@@ -445,7 +445,7 @@ def disallow_superuser_escalation(cls):
|
|||||||
def fx(self, request, *a, **kw):
|
def fx(self, request, *a, **kw):
|
||||||
if not request.user.is_superuser:
|
if not request.user.is_superuser:
|
||||||
is_su = request.DATA.get('is_superuser', False)
|
is_su = request.DATA.get('is_superuser', False)
|
||||||
if su and su != 'false':
|
if su and su not in ('false', 'f', 'False', '0'):
|
||||||
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