Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/customization.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ organization = session.exec(select(Organization).where(Organization.name == "Acm
user.has_permission(permission, organization)
```

You should create custom `AppPermissions` enum values for your application in `utils/app/` (if needed) and validate that users have the necessary permissions before allowing them to modify organization data resources.
You can add custom permission enum values to the `ValidPermissions` enum in `utils/core/enums.py` (below the core permissions section) and validate that users have the necessary permissions before allowing them to modify organization data resources.

### Cascade deletes

Expand Down
5 changes: 0 additions & 5 deletions utils/app/enums.py

This file was deleted.

15 changes: 12 additions & 3 deletions utils/core/enums.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
from utils.app.enums import AppPermissions
from enum import Enum

class ValidPermissions(AppPermissions):

class ValidPermissions(Enum):
"""
Core permissions - do not modify these:
"""
DELETE_ORGANIZATION = "Delete Organization"
EDIT_ORGANIZATION = "Edit Organization"
INVITE_USER = "Invite User"
REMOVE_USER = "Remove User"
EDIT_USER_ROLE = "Edit User Role"
CREATE_ROLE = "Create Role"
DELETE_ROLE = "Delete Role"
EDIT_ROLE = "Edit Role"
EDIT_ROLE = "Edit Role"

# Add additional app-specific permissions below this line:
READ_ORGANIZATION_RESOURCES = "Read Organization Resources"
WRITE_ORGANIZATION_RESOURCES = "Write Organization Resources"
DELETE_ORGANIZATION_RESOURCES = "Delete Organization Resources"