Orelo-Software

payload default roles

by Orelo-Software
Roles & permissions
v1
^1.2.1

Overview

Summary generated from the README

Adds default access control to all collections in a Payload config, granting access to a configurable list of roles. By default the roles are admin and executive. Specific collections can be excluded by slug. Registered through the plugins array and built for Payload 1.x.

Features

  • Applies default access rules to all collections automatically
  • Configurable list of roles, defaulting to admin and executive
  • Ignore selected collections by slug
  • Works with no options for quick setup

Use cases

  • Lock down every collection to admin roles without writing access functions per collection
  • Exclude user or admin collections from blanket role-based access defaults

From the author

Adds default access permissions to all collections

Installation

npm i @orelo/payload-default-roles

9

Stars

0

Forks

5

Open Issues

3 years ago

Last Updated

22

Weekly Downloads

v0.0.6

npm Version

8.1 KB

Unpacked Size

0

Dependencies

GitHub stars

90 since Sep 7

Show data
GitHub stars by day (UTC)
DateStars
Dec 6, 20269
Dec 5, 20269
Dec 4, 20269
Dec 3, 20269
Dec 2, 20269
Dec 1, 20269
Nov 30, 20269
Nov 29, 20269
Nov 28, 20269
Nov 27, 20269
Nov 26, 20269
Nov 25, 20269
Nov 24, 20269
Nov 23, 20269
Nov 22, 20269
Nov 21, 20269
Nov 20, 20269
Nov 19, 20269
Nov 18, 20269
Nov 17, 20269
Nov 16, 20269
Nov 15, 20269
Nov 14, 20269
Nov 13, 20269
Nov 12, 20269
Nov 11, 20269
Nov 10, 20269
Nov 9, 20269
Nov 8, 20269
Nov 7, 20269
Nov 6, 20269
Nov 5, 20269
Nov 4, 20269
Nov 3, 20269
Nov 2, 20269
Nov 1, 20269
Oct 31, 20269
Oct 30, 20269
Oct 29, 20269
Oct 28, 20269
Oct 27, 20269
Oct 26, 20269
Oct 25, 20269
Oct 24, 20269
Oct 23, 20269
Oct 22, 20269
Oct 21, 20269
Oct 20, 20269
Oct 19, 20269
Oct 18, 20269
Oct 17, 20269
Oct 16, 20269
Oct 15, 20269
Oct 14, 20269
Oct 13, 20269
Oct 12, 20269
Oct 11, 20269
Oct 10, 20269
Oct 9, 20269
Oct 8, 20269
Oct 7, 20269
Oct 6, 20269
Oct 5, 20269
Oct 4, 20269
Oct 3, 20269
Oct 2, 20269
Oct 1, 20269
Sep 30, 20269
Sep 29, 20269
Sep 28, 20269
Sep 27, 20269
Sep 26, 20269
Sep 25, 20269
Sep 24, 20269
Sep 23, 20269
Sep 22, 20269
Sep 21, 20269
Sep 20, 20269
Sep 19, 20269
Sep 18, 20269
Sep 17, 20269
Sep 16, 20269
Sep 15, 20269
Sep 14, 20269
Sep 13, 20269
Sep 12, 20269
Sep 11, 20269
Sep 10, 20269
Sep 9, 20269
Sep 8, 20269
Sep 7, 20269
npm weekly downloads

25+17 since Sep 7

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 6, 202625
Dec 5, 202625
Dec 4, 202613
Dec 3, 202612
Dec 2, 20265
Dec 1, 20267
Nov 30, 20269
Nov 29, 20266
Nov 28, 202614
Nov 27, 202614
Nov 26, 202618
Nov 25, 202622
Nov 24, 202620
Nov 23, 202619
Nov 22, 202622
Nov 21, 202613
Nov 20, 202612
Nov 19, 202610
Nov 18, 202618
Nov 17, 202620
Nov 16, 202620
Nov 15, 202618
Nov 14, 202618
Nov 13, 202618
Nov 12, 202616
Nov 11, 20264
Nov 10, 20268
Nov 9, 202612
Nov 8, 202634
Nov 7, 202640
Nov 6, 202652
Nov 5, 202656
Nov 4, 202662
Nov 3, 202666
Nov 2, 202669
Nov 1, 202648
Oct 31, 202642
Oct 30, 202631
Oct 29, 202627
Oct 28, 202621
Oct 27, 202614
Oct 26, 20266
Oct 25, 202612
Oct 24, 202615
Oct 23, 202614
Oct 22, 202616
Oct 21, 202618
Oct 20, 202615
Oct 19, 202616
Oct 18, 20268
Oct 17, 20265
Oct 16, 20265
Oct 15, 20263
Oct 14, 20262
Oct 13, 20262
Oct 12, 20261
Oct 11, 20262
Oct 10, 20262
Oct 9, 20262
Oct 8, 20262
Oct 7, 20261
Oct 6, 20261
Oct 5, 20261
Oct 4, 20261
Oct 3, 20262
Oct 2, 20262
Oct 1, 20265
Sep 30, 20265
Sep 29, 20265
Sep 28, 20265
Sep 27, 20265
Sep 26, 20267
Sep 25, 20267
Sep 24, 20264
Sep 23, 20264
Sep 22, 20265
Sep 21, 202611
Sep 20, 202610
Sep 19, 20268
Sep 18, 20268
Sep 17, 20268
Sep 16, 20269
Sep 15, 20269
Sep 14, 20263
Sep 13, 20263
Sep 12, 20263
Sep 11, 20263
Sep 10, 20264
Sep 9, 20267
Sep 8, 20268
Sep 7, 20268

Each point is npm's rolling 7-day download count.

Health Score

27/100Fair

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/571944068-root.svg)](https://payloaddirectory.dev/plugins/571944068-root)
HTML
<a href="https://payloaddirectory.dev/plugins/571944068-root"><img src="https://payloaddirectory.dev/badge/571944068-root.svg" alt="Payload Directory"></a>
Updated Oct 4, 2023Created Nov 29, 2022Published Dec 1, 2022

README

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

Similar plugins