Add Clerk-based RBAC for TinaCMS#576
Closed
jamiefolsom wants to merge 3 commits intofeature/tinacms-upgrade-3.6from
Closed
Add Clerk-based RBAC for TinaCMS#576jamiefolsom wants to merge 3 commits intofeature/tinacms-upgrade-3.6from
jamiefolsom wants to merge 3 commits intofeature/tinacms-upgrade-3.6from
Conversation
Two roles: admin (full access) and editor (own content only). Clerk added as third auth option alongside Keycloak SSO and AuthJS. Backend: - Custom ClerkRBACAuth verifies tokens and extracts role from Clerk publicMetadata with 60s token cache - enforceEditorRules() intercepts GraphQL mutations: blocks admin-only collections, strips published field, enforces ownership on updates/deletes Schema: - Add published, owner_id, owner_name fields to posts, pages, paths - Replace conditional publish/drafts with unconditional published - Add beforeSubmit hooks for auto-populating ownership - Remove posts_config.drafts from settings Frontend: - PublishedToggle: visible to admins, hidden for editors - ReadOnlyText: displays owner_name as static text - role-ui.ts: sets data-tina-role, hides admin-only sidebar items - Exclude TinaUserCollection when using Clerk auth Public site: - Filter all content queries by published: true - Individual document fetches return null if unpublished - Home pages and preview routes bypass published check
Member
Author
|
Superseded by #577 (RB-clerk-auth) which implements Clerk RBAC independently. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
publishedfield to posts, pages, and paths (replaces olddraftssystem)owner_id,owner_name) to content collectionspublishedTest plan
TINA_PUBLIC_AUTH_USE_CLERK=truewith Clerk keys, verify admin loadsIncludes #575 and #574