Skip to content

Absorb the roles bricks and ask capabilities #81

Closed

Description

@SirLouen

Current state: AlphOne keeps its own roles data in core.user_roles, guards the last admin with hand-written SQL joining the brick's tables, stamps the role onto the session through a wrapper, widens react-auth's Account type by hand to carry it, and pins authkit v0.5.0, authkit/postgres v0.3.0 and react-auth 0.4.0, three trains behind bricks that now carry a role on every account with a last privileged guard of their own. Every decision point compares the role to admin instead of asking a capability.

Proposal: absorb the roles bricks, gouncer v0.3.0, authkit v0.9.0, authkit/postgres v0.7.0 and react-auth 0.6.0, moving the role into the brick's column by a migration that copies core.user_roles and drops it, deleting the three hacks, and adding a capability table naming admin, member and a superadmin that alone holds manage_tenants, with a dropdown in the users screen listing only the roles the reader outranks and a rule that nobody grants or touches a role holding a capability it lacks. The @scope directive gains a capability argument so the gate asks Can rather than comparing roles. Superadmin is never written by a migration or a default, only by createadmin -role superadmin.

rigger: the four brick releases are tagged and Gophenberg 0.8.0 has battle tested them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions