#Recommended approach to setup up custom modal on document save

4 messages · Page 1 of 1 (latest)

tough jetty
#

What is the payload cms recommended way to add a custom modal when user saves the document on edit view. I need to conditionally show this based on the user role. Do i need to create a whole new custom edit view or can do this by replacing just the save button component. what is the recommended way to access user information and collection information on the custom component and implement this? Also give some guidance on using server vs client components in this context

tough jetty
#

if i get the user using useAuth hook then i dont have access to the user roles in the object. so what's the recommended way to do this? should i expose it in the jwt?

tough jetty
#

even if i expose the role through saveToJWT the user object returned by calling useAuth doesn't consitently return the role