mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 18:07:36 -02:30
update permission logic, update job runtime tests
This commit is contained in:
@@ -2119,12 +2119,12 @@ class JobTemplateLaunch(RetrieveAPIView, GenericAPIView):
|
||||
|
||||
if 'credential' in prompted_fields and prompted_fields['credential'] != getattrd(obj, 'credential.pk', None):
|
||||
new_credential = Credential.objects.get(pk=prompted_fields['credential'])
|
||||
if not request.user.can_access(Credential, 'read', new_credential):
|
||||
if not request.user.can_access(Credential, 'use', new_credential):
|
||||
raise PermissionDenied()
|
||||
|
||||
if 'inventory' in prompted_fields and prompted_fields['inventory'] != getattrd(obj, 'inventory.pk', None):
|
||||
new_inventory = Inventory.objects.get(pk=prompted_fields['inventory'])
|
||||
if not request.user.can_access(Inventory, 'read', new_inventory):
|
||||
if not request.user.can_access(Inventory, 'use', new_inventory):
|
||||
raise PermissionDenied()
|
||||
|
||||
kv = prompted_fields
|
||||
|
||||
Reference in New Issue
Block a user