https://cerbos.dev logo
#help
Title
# help
b

Brandon Choe

06/20/2023, 6:01 PM
hi 👋. is there a best practice for conditional rendering of UI, e.g. only show an edit button if the user has permission to edit? I couldn't find any docs on this. at first, we put some logic into the frontend, but we realized that we were essentially duplicating some derived role conditions. is it as simple as having an api endpoint that the frontend can use to reach cerbos to ask if the user has permission to edit?
d

Dennis (Cerbos)

06/20/2023, 9:23 PM
Hi Brandon, Here’s a summary of a relevant GH discussion: • When your front-end app hits your backend to fetch the data, return the permissions so you can conditionally render UI components based on what the user can do. • A better solution is coming.
b

Brandon Choe

06/21/2023, 12:17 AM
awesome, thank you!
2 Views