Skip to content

feat: add capabilities column and JWT support#148

Open
jakebromberg wants to merge 1 commit intomainfrom
feature/capabilities
Open

feat: add capabilities column and JWT support#148
jakebromberg wants to merge 1 commit intomainfrom
feature/capabilities

Conversation

@jakebromberg
Copy link
Member

Summary

Adds cross-cutting capabilities (e.g., editor, webmaster) to the auth system, independent of the role hierarchy.

  • Add capabilities text[] column to auth_user table (migration 0026)
  • Register capabilities as a Better Auth additionalField on the user schema
  • Include capabilities in JWT payload via definePayload
  • Add unit tests for capability storage and JWT structure

Context

Split out from #143, which mixed this work with email account-setup changes that have since been superseded by #145 and #147.

Part of a cross-repo rollout:

Repo Change Status
wxyc-shared Capabilities module with types and helpers Merged
Backend-Service Database column, schema, JWT payload This PR
dj-site Capability management UI in roster #117

Test plan

- Add capabilities text[] column to auth_user table
- Include capabilities in JWT payload via definePayload
- Register capabilities as Better Auth additionalField
- Add unit tests for capability storage and JWT structure
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