Skip to content

Cerbos with react in production #1603

Answered by alexolivier
dipbazz asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @dipbazz

There are a few ways to approach this - but at a more high level, in order to check permissions the call does need to go to the backend where Cerbos is running where you can securely verify the user's identity and fetch the resource attributes as calling directly from the frontend would require all the attributes about the principal and the resource to be available client-side/in the browser first - at which point checking things like 'read' permission is a bit redundant.

The way we recommend approaching this is when your react app hits your backend to fetch the data, return the permissions along with it so you can then conditional render UI components based on what the user …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alexolivier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants