permissions.py 438 B

123456789101112
  1. from apps.organizations_ext.permissions import OrganizationPermission
  2. from apps.projects.permissions import ProjectPermission
  3. class EnvironmentPermission(OrganizationPermission):
  4. def get_user_scopes(self, obj, user):
  5. return obj.organization.get_user_scopes(user)
  6. class EnvironmentProjectPermission(ProjectPermission):
  7. def get_user_scopes(self, obj, user):
  8. return obj.project.organization.get_user_scopes(user)