Add Project Admin role

This commit is contained in:
Wayne Witzel III
2018-01-26 00:33:07 +00:00
parent 605a2c7e01
commit e7e83afd00
4 changed files with 12 additions and 4 deletions

View File

@@ -1087,8 +1087,8 @@ 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 self.check_related('organization', Organization, data, mandatory=True)
return Organization.accessible_objects(self.user, 'project_admin_role').exists()
return self.check_related('organization', Organization, data, role_field='project_admin_role', mandatory=True)
@check_superuser
def can_change(self, obj, data):