Skip to content

Im trying to learn payload and I have been checking the examples for auth but im getting error when importing Access types #9981

Discussion options

You must be logged in to vote

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

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@GerardPolloRebozado
Comment options

@andershermansen
Comment options

@GerardPolloRebozado
Comment options

@andershermansen
Comment options

Answer selected by GerardPolloRebozado
@GerardPolloRebozado
Comment options

@andershermansen
Comment options

@GerardPolloRebozado
Comment options

@JoeCars
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants