mirror of
https://github.com/ansible/awx.git
synced 2026-02-28 00:08:44 -03:30
Fixing CredentialList post access check
This commit is contained in:
@@ -1225,7 +1225,7 @@ class CredentialList(ListCreateAPIView):
|
|||||||
organization = Organization.objects.get(pk=request.data['organization'])
|
organization = Organization.objects.get(pk=request.data['organization'])
|
||||||
obj = organization
|
obj = organization
|
||||||
|
|
||||||
if self.request.user not in obj.admin_role:
|
if not self.request.user.can_access(type(obj), 'admin', obj, request.data):
|
||||||
raise PermissionDenied()
|
raise PermissionDenied()
|
||||||
|
|
||||||
ret = super(CredentialList, self).post(request, *args, **kwargs)
|
ret = super(CredentialList, self).post(request, *args, **kwargs)
|
||||||
|
|||||||
Reference in New Issue
Block a user