Im trying to learn payload and I have been checking the examples for auth but im getting error when importing Access types #9981
Answered
by
andershermansen
GerardPolloRebozado
asked this question in
Q&A
-
This code from the template doesnt works and both vscode and webstorm say "Cannot find module 'payload/config' or its corresponding type declarations."
|
Beta Was this translation helpful? Give feedback.
Answered by
andershermansen
Dec 19, 2024
Replies: 1 comment 8 replies
-
You should be able to import |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It can be used to apply access restrictions. So for example if you in your Users collection use this adminsAndUser on the read access defintion then any person with admin can see all users, but if you do not have admin then payload will apply the where (id equals user.id). The user object is the current logged in user, so when it's applied it will basically filter so that you only see your own user.
Read more about access control here: https://payloadcms.com/docs/access-control/overview