Adds default access control to every collection in a Payload config based on a list of roles. By default access is granted to the admin and executive roles, and the roles can be changed through options. Specific collections can be excluded by slug. It is registered as a plugin in the Payload config and targets Payload 1.x.
Adds default access permissions to all collections
Installation
npm i @orelo/payload-default-roles9
Stars
0
Forks
5
Open Issues
3 years ago
Last Updated
0
Weekly Downloads
v0.0.6
npm Version
8.1 KB
Unpacked Size
0
Dependencies
Trends appear after 7 days of data. Daily snapshots have not started yet.
Trends appear after 7 days of data. Daily snapshots have not started yet.
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/571944068-root)<a href="https://payloaddirectory.dev/plugins/571944068-root"><img src="https://payloaddirectory.dev/badge/571944068-root.svg" alt="Payload Directory"></a>README
Add default roles for access control on all collections.
ignoredSlugs: string[] OptionalAn array of the slugs from the collections this plugin should leave untouched.
roles: string[] OptionalAn array of the roles this plugin should default access to.
Default: ["admin", "executive"]
// payload.config.ts
import { buildConfig } from 'payload/config';
import { defaultAccess } from '@orelo/payload-default-roles';
export default buildConfig({
plugins: [
defaultAccess(), // Pass nothing to use the default options
],
});
export default buildConfig({
plugins: [
defaultAccess({
ignoredSlugs: ['cms-user', 'admin'],
roles: ['administrator', 'moderator'],
}),
],
});
Topics
multi tenant
Manage multiple tenants with scoped content and access from a single Payload admin panel
10090.4k/wk45.4kv3
rbac
Database-stored roles with a per-collection CRUD permission matrix enforced across all collections and globals
6327/wk15v3
payload plugin rbac
Database-driven role-based access control with a permission matrix and data scoping for Payload
5627/wk10v3
rbac
Database-driven role-based access control with a per-collection permissions matrix in the Payload admin
530/wk0v4
abac
Attribute-based access control that compiles user attributes into Payload where clauses
520/wk181v3
Payload RBAC Plugin
Database-backed role and permission management with row-level conditions for Payload collections
500/wk6v3