-
I'm trying-out Triplit and the Clerk free tier (without an organization), and I'm trying to add manually-managed RBAC via metadata as described in Clerk's documentation here: https://clerk.com/docs/references/nextjs/basic-rbac. The JWT now contains: "publicMetadata": {
"role": "user"
}, Would this be the correct corresponding Role definition? How can I check which role (if any) matches the active triplit session? export const roles: Roles = {
admin: {
match: {
'publicMetadata.role': 'admin',
sub: '$userId',
},
},
user: {
match: {
'publicMetadata.role': 'user',
sub: '$userId',
},
},
}; |
Beta Was this translation helpful? Give feedback.
Answered by
wernst
Apr 11, 2025
Replies: 1 comment
-
Hi @cahna , sorry for the delay in the response here. That should match via something like this: export const roles: Roles = {
admin: {
match: {
publicMetadata: {
role: 'admin',
}
sub: '$userId',
},
},
user: {
match: {
publicMetadata: {
role: 'user'
},
sub: '$userId',
},
},
}; |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
wernst
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @cahna , sorry for the delay in the response here. That should match via something like this: