permissions.py 397 B

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