mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 13:39:27 -02:30
Prevent launching ad hoc commands when license has expired.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -2309,6 +2309,7 @@ class AdHocCommandList(ListCreateAPIView):
|
||||
model = AdHocCommand
|
||||
serializer_class = AdHocCommandListSerializer
|
||||
new_in_220 = True
|
||||
always_allow_superuser = False
|
||||
|
||||
@csrf_exempt
|
||||
@transaction.non_atomic_requests
|
||||
|
||||
Reference in New Issue
Block a user