mirror of
https://github.com/ansible/awx.git
synced 2026-02-18 11:40:05 -03:30
Merge pull request #273 from chrismeyersfsu/fix-job_launch_credential_permissions
restrict the set of valid, explicitly supplied credentials to be ones readable by the user
This commit is contained in:
@@ -1755,6 +1755,10 @@ class JobTemplateLaunch(RetrieveAPIView, GenericAPIView):
|
||||
if not serializer.is_valid():
|
||||
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
# At this point, a credential is gauranteed to exist at serializer.object.credential
|
||||
if not request.user.can_access(Credential, 'read', serializer.object.credential):
|
||||
raise PermissionDenied()
|
||||
|
||||
kv = {
|
||||
'credential': serializer.object.credential.pk,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user