|
1 | | -# ADR 0028: Profile-Centric Authorization and Governance Model |
| 1 | +# ADR 0028: Enterprise Profile-Centric Authorization and Governance Model |
2 | 2 |
|
3 | 3 | ## Status |
4 | | -Proposed |
| 4 | +Refactored (Enterprise Standards) |
5 | 5 |
|
6 | 6 | ## Context |
7 | | -The previous authorization model relied on a direct association between Users, Roles, and Permissions. This led to conceptual inconsistencies where permission overrides for a specific user required creating a new role or managing ad-hoc assignments, complicating governance and audit. There is a need for a central entity that encapsulates the entire context of an authorization (User, Role, System, Branch, and Tenant) and serves as the container for "Effective Permissions". |
| 7 | +Standard RBAC models fail in multi-tenant, multi-suite enterprise environments where permissions are contextualized by organizational structure (Branches) and functional boundaries (Systems). Direct user-role assignment creates governance gaps. A robust model must isolate roles within systems and consolidate authority at a single contextual pivot: the **Profile**. |
8 | 8 |
|
9 | 9 | ## Decision |
10 | | -We will transition to a **Profile-Centric Authorization Model**. |
| 10 | +We will implement an **Enterprise Profile-Centric Authorization Model** governed by the following strict rules: |
11 | 11 |
|
12 | | -1. **Profile as the Governance Axis**: |
13 | | - * A **Profile** is the atomic unit of authorization. |
14 | | - * It is a contextual composition of: `UserId` + `RoleId` + `SystemId` + `BranchId` + `TenantId`. |
15 | | - * A user can have multiple profiles (e.g., "Manager in Branch A" and "Auditor in Branch B"). |
| 12 | +1. **Strict Hierarchical Ownership**: |
| 13 | + * A **Tenant** owns its **Users**, **Systems (Suites)**, and **Branches**. |
| 14 | + * A **System** belongs to a single Tenant. |
| 15 | + * A **Role** belongs to a single System. Global roles are prohibited. |
| 16 | + * A **Permission** belongs to the functional context of a System. |
16 | 17 |
|
17 | | -2. **Effective Permission Persistence**: |
18 | | - * Instead of resolving permissions on-the-fly from roles, the final set of authorizations will be persisted at the **Profile** level in a `ProfilePermissions` table. |
19 | | - * This allows for granular **Overrides** (adding or removing permissions) for a specific profile without affecting other users sharing the same Role. |
| 18 | +2. **Profile as the Contextual Nexus**: |
| 19 | + * The **Profile** is the unique intersection of: `Tenant` + `System` + `Branch` + `User` + `Role`. |
| 20 | + * Authorizations are resolved and persisted at the **Profile** level as "Effective Permissions". |
20 | 21 |
|
21 | | -3. **Traceability and Audit Standards**: |
22 | | - * All authorization changes must be tracked with a `TransactionId` or `AuditId`. |
23 | | - * Every entity in the system will follow the **Standard Corporate Audit Schema** (Created, Updated, Deleted, Version, Status). |
| 22 | +3. **Governance & Audit Standards**: |
| 23 | + * Every entity must implement the **Corporate Audit Schema** (10+ columns). |
| 24 | + * Support for **Soft Delete**, **Optimistic Locking**, and **Audit Trails** is mandatory for all persistence operations. |
| 25 | + * **Traceability**: Critical security operations must track `CorrelationId`, `AuditId`, and `TransactionId`. |
24 | 26 |
|
25 | | -4. **Decoupling**: |
26 | | - * **Role**: A blueprint of permissions. |
27 | | - * **Profile**: A contextual implementation of a Role for a specific User and Branch. |
| 27 | +4. **Authorization Engine**: |
| 28 | + * The engine resolves permissions by querying the **Effective Permissions** table for the current `ProfileId`. |
| 29 | + * Supports **Overrides** (Grant/Deny) at the Profile level for maximum granularity. |
28 | 30 |
|
29 | 31 | ## Technical Implementation |
30 | | -* The `Users` table will no longer be directly linked to `Roles`. |
31 | | -* The `Profiles` table becomes the central junction point. |
32 | | -* The `Authorization Engine` will resolve permissions by querying the **Active Profile ID** in the execution context. |
| 32 | +* **Cardinality**: `Tenant (1:N) System (1:N) Role (1:N) Profile`. |
| 33 | +* **Persistence**: Effective permissions are projected from `Role -> ProfilePermission` upon profile creation/sync. |
33 | 34 |
|
34 | 35 | ## Consequences |
35 | | -* **Positive**: Perfect granularity for overrides, simplified audit (one place to see what a user can do in a specific context), and better alignment with complex organizational structures. |
36 | | -* **Negative**: Higher number of rows in the permission tables (`ProfilePermissions`) and the need for logic to keep profiles in sync with their source roles/templates when required. |
| 36 | +* **Positive**: Perfect isolation, simplified contextual resolution, full auditability, and massive scalability for multi-org environments. |
| 37 | +* **Negative**: Increased metadata management and the requirement for a robust synchronization logic between Roles and Profiles. |
0 commit comments