Payload Default Roles
Add default roles for access control on all collections.
Options
-
ignoredSlugs: string[]
Optional
An array of the slugs from the collections this plugin should leave untouched.
-
roles: string[]
Optional
An array of the roles this plugin should default access to.
Default: ["admin", "executive"]
Example
import { buildConfig } from 'payload/config';
import { defaultAccess } from '@orelo/payload-default-roles';
export default buildConfig({
plugins: [
defaultAccess(),
],
});
Example with Options
export default buildConfig({
plugins: [
defaultAccess({
ignoredSlugs: ['cms-user', 'admin'],
roles: ['administrator', 'moderator'],
}),
],
});