Hello!
I don't think I found this anywhere, or maybe I'm blind. I need to retrieve the user's access permissions. For example, I wanna know if a user has "create" access on a particular collection.
I browsed the payload repo but I only found server-side utility functions heavily embedded into the working architecture of payload, and none that allows retrieving collection permissions client-side.
My usecase is rather simple: I have the payload SUPER admin UI, and the user dashboard. I want to keep the payload dashboard to administrators only, but the user dashboard is a custom-made UI which has dashboards and many more things, as well as some listviews and editviews for a subset of payload collections (I call "exposed" collections). Since this is a custom UI, it falls outside of the payload context. The problem I am facing is that I cannot know which collection a user has access, or whether they have read, create, update, or delete permissions.
Is there a way to retrieve such access information client-side outside of payload context? Thank you very much 🙏 I have an ikling that I could use the permissions returned by payload.auth? Am I on the right track?