Prevent launching ad hoc commands when license has expired.

This commit is contained in:
Chris Church
2015-05-21 14:13:13 -04:00
parent c46c58fe7a
commit 1b1d43dc59
5 changed files with 47 additions and 2 deletions

View File

@@ -108,7 +108,7 @@ class ModelAccessPermission(permissions.BasePermission):
raise PermissionDenied('your account is inactive')
# Always allow superusers (as long as they are active).
if request.user.is_superuser:
if getattr(view, 'always_allow_superuser', True) and request.user.is_superuser:
return True
# Check if view supports the request method before checking permission