Skip to content

ADR: Defining permission dependencies via Yaml extensibility #523

Closed

Description

@rodmgwgu

Expand the YAML definition to allow defining permission dependencies similar to how they are currently defined in the casbin policy via "g2" entries.

The objective of this is:

  1. Allow the full retirement of the casbin policy file (authz.policy) (currently, the only reason for it to remain is because of the g2 entries).
  2. Enable dependency visibility for future Custom Roles functionality.

Activity

  1. added
    willow
    on Oct 30, 2026
  2. hsluoyz commented on Oct 31, 2026

    @hsluoyz

    I added a docs section on g2 and permission dependencies that is relevant here:

    https://casbin.apache.org/docs/rbac#named-role-systems-and-permission-dependencies

    Two points that may help with retiring authz.policy:

    • g, g2, ... are independent role systems, not a built-in "permission depends on permission" relation. A g2 row only changes a decision if the matcher calls g2(...).
    • If the dependency is authorization semantics, modeling it as role inheritance is usually simpler. If it is catalog metadata (as in the second objective here), the YAML schema can stay the source of truth and expand into p / g / g2 rows when the policy is generated. Casbin does not require those rows to live in a CSV file; an adapter can load them from your database or from the YAML/JSON catalog.

    Commit: apache/casbin-website@15ca994e0

  3. moved this to In Progress in RBAC AuthZ Boardon Nov 4, 2026
  4. moved this from In Progress to Ready for Review in RBAC AuthZ Boardon Nov 4, 2026
  5. self-assigned this
    on Nov 5, 2026
  6. moved this from Ready for Review to Done in RBAC AuthZ Boardon Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

willow

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions