Skip to content

Commit 8ede79e

Browse files
refactor: drop grouping decision in favor of more flexible approach
1 parent f51ddca commit 8ede79e

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

docs/decisions/0006-policy-store-and-enforcement-model.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ Use a Casbin Model CONF that Supports Core Principles
2626
- Favor simple matchers to improve performance and maintainability. This means avoiding complex regexes and nested logic where possible.
2727
- Use Casbin's built-in support for role hierarchies (g, g2) to manage role inheritance and simplify policy definitions.
2828

29-
Do not Handle Grouping and Context Inheritance via Casbin's Built-in Mechanisms
30-
-------------------------------------------------------------------------------
31-
- Grouping resources will not be implemented via Casbin's built-in grouping mechanisms (g, g2) but will be explicitly managed when checking permissions in the application layer. For example, if a user has the ``course_admin`` role in ``org:123``, this will not automatically grant them the ``course_admin`` role in all courses within that org. Instead, the application layer will need to check both the user's role and the specific context (e.g., organization or course) when making authorization decisions.
32-
- Define roles that are context-specific, such as ``course_admin`` for a specific course or ``org_admin`` for a specific organization.
33-
3429
Establish Naming Conventions for Subjects, Actions, Objects, and Contexts
3530
-------------------------------------------------------------------------
3631
- Favor the use of simple and easy to read matchers and policies to keep the system maintainable. Revisit complexity if needed.
@@ -118,8 +113,6 @@ Consequences
118113

119114
#. **Default Deny Policy**: The default behavior of the authorization engine will be to deny access unless explicitly allowed by a policy. This is a security best practice that minimizes the risk of unauthorized access.
120115

121-
#. **Grouping will be Handled in the Application Layer**: Instead of using Casbin's built-in grouping mechanisms, the application layer will handle grouping and context inheritance. This provides greater flexibility and allows for more complex authorization logic that is specific to the application's needs.
122-
123116
#. **The Casbin Table Schema will Include Metadata**: The policy store schema will include metadata fields to differentiate between static and dynamic policies. This allows for better management and auditing of policies.
124117

125118
#. **Static Policies will be Immutable**: Policies defined in the ``authz.policy`` files will be immutable after being loaded into the policy store. For a policy to be removed, should go through a deprecation cycle where it is first marked as deprecated and then removed in a future version.

0 commit comments

Comments
 (0)