mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 19:30:39 -03:30
Merge pull request #2846 from AlanCoding/2842_proj_api
Show the project list POST text box for org admins in API browser
This commit is contained in:
commit
ace2f1e207
@ -722,6 +722,8 @@ class ProjectAccess(BaseAccess):
|
||||
|
||||
@check_superuser
|
||||
def can_add(self, data):
|
||||
if not data or '_method' in data:
|
||||
return Organization.accessible_objects(self.user, 'admin_role').exists()
|
||||
organization_pk = get_pk_from_dict(data, 'organization')
|
||||
org = get_object_or_400(Organization, pk=organization_pk)
|
||||
return self.user in org.admin_role
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user