Skip to content

chore(permissions): gate key actions with usePermissions#7

Open
johnleider wants to merge 1 commit into
phase-a-key-lifecyclefrom
chore/permissions-gates
Open

chore(permissions): gate key actions with usePermissions#7
johnleider wants to merge 1 commit into
phase-a-key-lifecyclefrom
chore/permissions-gates

Conversation

@johnleider

Copy link
Copy Markdown
Member

Summary

  • Wire the already-registered createPermissionsPlugin into real dashboard flows via usePermissions
  • Fix the role matrix to exact action/subject pairs (admin.manage.* was never matched β€” adapter looks up literal paths)
  • Persist demo role with useRole / useStorage; Settings tab role switcher demos create / rotate / revoke grants
  • Hide New Key, table actions, bulk revoke, and command-palette actions the role cannot perform

Test plan

  • Load dashboard as default admin β€” create / rotate / revoke all visible and work
  • Settings β†’ switch to developer β€” revoke column/bulk hidden; create + rotate still work
  • Switch to viewer β€” New Key hidden; no rotate/revoke; Cmd+K action list omits create/rotate
  • Reload β€” role selection persists

Wire the already-registered permissions plugin into real product flows.
Expand the role matrix to exact action/subject pairs (adapter has no
wildcard expansion), persist the demo role via useStorage, and hide
create/rotate/revoke UI that the current role cannot perform.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant