Skip to content

Commit 6e30a68

Browse files
authored
Merge pull request #5497 from bcgov/docs/5424
docs(1095): add roles and permissions system
2 parents fcf4f16 + 2fbba42 commit 6e30a68

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed
Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
11
# Roles and Permissions
22

3-
**_TO BE COMPLETED_**
3+
The Registry application supports complex and flexible permission use cases through a two-level system of roles and permissions: **global-level** and **document-level** (e.g., product-specific).
4+
5+
## Global Roles
6+
7+
Global roles are defined in **Keycloak**. When a user logs in, the system retrieves their roles from the JWT token issued by Keycloak. These roles are available in the user's session data on both the backend and frontend.
8+
9+
## Global Permissions
10+
11+
Global permissions are defined in the backend codebase. They are assigned based on the user's roles and are also included in the session data, accessible from both the backend and frontend.
12+
13+
## Document-Level Permissions
14+
15+
When a document is retrieved using one of the system’s core database wrapper modules (located under `/services/db/models`), it is automatically decorated with additional fields—most notably, a `_permissions` field. This field reflects the document-level permissions, taking into account both the document context and the user's global permissions.
16+
17+
Since documents are fetched from this core module, the frontend is expected to rely on the decorated permissions to configure UI behavior. This approach simplifies privilege-related logic on the frontend and ensures consistent permission handling across the application.

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ nav:
120120
- EMou Workflow: business-logic/public-cloud/emou-workflow.md
121121
- Email Scenario: business-logic/public-cloud/email-scenario.md
122122
- Research:
123+
- research/gold-migration-and-dr.md
123124
- research/image-scanner.md
124125
- Tests:
125126
- tests/api-testing.md

0 commit comments

Comments
 (0)