Hello community. I want my application that uses payload to have a global login and not by collection. This login should return me a token which would give me access to query all collections.
Authentication is always per-collection but it sounds like you might want to implement basic access control. If you give your auth-enabled collection a
roles
field then controlled access based on its value, you could provide some users with “super-admin” capabilities while restricting the others
hi @jacobsfletch !
Thanks for your quick response.
That sounds really good. Do you know where I can configure the collections so that they restrict their access based on a user role?
Use the
access
property on your collection config, here’s an example
https://github.com/payloadcms/payload/blob/master/examples/auth/cms/src/collections/Users.tsand then here’s the doc for reference
https://payloadcms.com/docs/access-control/overview#access-controlThank you very much for the info!!
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.