Socket
Book a DemoInstallSign in
Socket

@orelo/payload-default-roles

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@orelo/payload-default-roles

Adds default access permissions to all collections

latest
Source
npmnpm
Version
0.0.6
Version published
Maintainers
2
Created
Source

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

// 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
  ],
});

Example with Options

export default buildConfig({
  plugins: [
    defaultAccess({
      ignoredSlugs: ['cms-user', 'admin'],
      roles: ['administrator', 'moderator'],
    }),
  ],
});

Keywords

payload

FAQs

Package last updated on 01 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts