#Access Configuration for Built-In User Collection
1 messages · Page 1 of 1 (latest)
Original message from @ivory badge - Moved from #general message
Help is on the way! To mark it as solved, use the /solve command. In the meantime, here are some existing threads that may help you:
Documentation:
- The Admin Panel - Admin Options - The Admin User Collection
- API Key Strategy - HTTP Authentication
- Collection Access Control - Config Options - Delete
Community-Help:
Hey @ivory badge
Walk me through what you want to see here
Hey
How do you mean "What is exposed"?
Was wondering how access for user collection is configured
Is it something like AdminOrSelf?
Or what is default?
I think you mean specifically for the case where the user doesn't describe their own distinct User collection?
I noticed it's different from any other collection
Yeah
Okay, one sec, let me find it
As far as I know, collections are accessible (read) by anyone by default
This doesn't seem to apply to user collection
Which makes sense obviously
collections are accessible by anyone by default
So, typically, default access controls on collections/globals are equivalent to(req: { user }) => Boolean(user)
Or in plain English: If you are logged in, you have access
It may be different for User collection though, let me check
Thanks
I am curious what would happen if I add a new field called avatar for example:
{
name: 'avatar',
type: 'upload',
label: 'Avatar',
relationTo: 'userAvatars',
}
Access wise
Would this only be accessible by owner and admins or anyone?
That's what I am looking for...
This is the default users collection: https://github.com/payloadcms/payload/blob/main/packages/payload/src/auth/defaultUser.ts
I think just the default access check is applied to it as well
Is this like in the context of a plugin?
Because it so, you could make it so that the field itself is customizable by letting users define overrides
So they can customize how the access should work