1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 15:21:13 +03:00

Allow more falsy values.

This commit is contained in:
Luke Sneeringer 2014-11-20 11:13:26 -06:00
parent 46ef0475d4
commit 8b1f3c33a5

View File

@ -445,7 +445,7 @@ def disallow_superuser_escalation(cls):
def fx(self, request, *a, **kw):
if not request.user.is_superuser:
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 '
'other superusers.')
return method(self, request, *a, **kw)