permissions.py 504 B

12345678910111213
  1. from glitchtip.permissions import ScopedPermission
  2. class ReleasePermission(ScopedPermission):
  3. scope_map = {
  4. "GET": ["project:read", "project:write", "project:admin", "project:releases"],
  5. "POST": ["project:write", "project:admin", "project:releases"],
  6. "PUT": ["project:write", "project:admin", "project:releases"],
  7. "DELETE": ["project:admin", "project:releases"],
  8. }
  9. def get_user_scopes(self, obj, user):
  10. return obj.organization.get_user_scopes(user)