mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-22 07:51:52 -05:00
updates to prompt-for tests and logic for new RBAC updates
This commit is contained in:
@@ -2120,12 +2120,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, 'use', new_credential):
|
||||
if request.user not in new_credential.use_role:
|
||||
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, 'use', new_inventory):
|
||||
if request.user not in new_inventory.use_role:
|
||||
raise PermissionDenied()
|
||||
|
||||
kv = prompted_fields
|
||||
|
||||
Reference in New Issue
Block a user