Fix a bug that did not allow project_admin's to create a project.

This was a regression from previous functionality
This commit is contained in:
Matthew Jones
2018-11-19 10:52:11 -05:00
parent b17c477af7
commit 61916b86b5
2 changed files with 26 additions and 1 deletions

View File

@@ -1208,7 +1208,7 @@ class ProjectAccess(BaseAccess):
@check_superuser
def can_add(self, data):
if not data: # So the browseable API will work
return Organization.accessible_objects(self.user, 'admin_role').exists()
return Organization.accessible_objects(self.user, 'project_admin_role').exists()
return (self.check_related('organization', Organization, data, role_field='project_admin_role', mandatory=True) and
self.check_related('credential', Credential, data, role_field='use_role'))