Skip to content

3. Definition translation #411

Description

@BryanttV

Description

This is the highest-effort task because it connects the new declarative layer to the enforcement behavior already validated by the PoC with Casbin.

  • Loader/transformer: build the component that translates validated YAML/dict definitions into Casbin policies (roles → grouping policies, permissions → policy rules).
  • Two input sources (per the document's diagram): static definitions specified by a plugin at startup, and dynamic policies specified by an admin at runtime via REST API — both must converge into the same "Extended/Loaded Policy."
  • Synchronization: define when the policy gets reloaded (only at startup, or should hot-reload be supported when a module is installed/updated without restarting the process).
  • Preserve metadata after loading: Casbin only understands policy strings; ensure display_name, description, and resource aren't lost in translation to Casbin, and remain accessible for the metadata APIs.
  • Compatibility with existing core roles/permissions: don't break current built-in roles during the migration to this unified loader.
Image

Concrete deliverable: a role or permission defined declaratively (by core or an external module) can be assigned to a user and correctly enforced by Casbin, with its metadata intact.

Metadata

Metadata

Assignees

No one assigned

    Labels

    willowReleased in Willow

    Type

    No type

    Projects

    Status
    Blocked

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions