@bison-lab/payload-core 3.13.0 → 3.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -261,10 +261,13 @@ has its accessible name. Then `payload migrate:create`.
261
261
  ## Roles
262
262
 
263
263
  Settings → Roles is an Admin-editable array. Rank is drag-to-reorder.
264
- Ticks are Content, Brand, Publish, and Users. Defaults ship in the
265
- package (Brand on Designer only; Admin + Designer both store; Developer
266
- is exclusive). A site may pass `extras` into `createRoles` each extra
267
- is a slug, a display label, and default ticks — and an Admin can add
264
+ Ticks are the catalogue rows released on Features. Developer is
265
+ implicit every catalogue feature, including ones not released. That
266
+ row is visible only to a Developer, with every tick on and locked.
267
+ Defaults ship in the package (Theme
268
+ screens on Designer; Designer also has Users and Roles; Admin + Designer
269
+ both store). A site may pass `extras` into `createRoles` — each extra
270
+ is a slug, a display label, and default `grants` — and an Admin can add
268
271
  further custom rows and edit any row’s name. Seed slugs stay read-only.
269
272
  `canManageBrand` and the other predicates read the saved Global and fall
270
273
  back to that seed (plus extras). The package never writes `developer`
@@ -272,26 +275,30 @@ onto a user row.
272
275
 
273
276
  ```ts
274
277
  createRoles({
275
- extras: [{ role: "editor", label: "Editor", content: true, brand: false, publish: false, users: false }],
278
+ extras: [{ role: "editor", label: "Editor", grants: ["content"] }],
276
279
  });
277
280
  ```
278
281
 
279
282
  ## Features
280
283
 
281
- Settings → Features is a feature × role grid. The catalogue is code:
282
- Pages, Media, Theme, Brand assets, Users, Roles, and Features. A site
283
- may pass `extras` into `createFeatures` those rows appear only there.
284
- `canUseFeature(slug)` reads the saved grid and falls back to Content →
285
- Pages/Media and Brand Theme/Brand assets when the Global is empty.
286
- Users, Roles, and Features cannot be turned off; Developer is always
287
- allowed. `createPages` / `createMedia` use `canUseFeature` for create
288
- and update (and `admin.hidden`). Theme and brand-assets still take
289
- `access` arguments pass `canUseFeature("theme")` /
290
- `canUseFeature("brand-assets")` as `update`.
284
+ Settings → Features is a Developer-only release valve: one switch per
285
+ catalogue row. Off hides the tick on Roles; Developer still has the
286
+ feature. The catalogue is code, grouped for the UI: Pages (Content,
287
+ Publish, API tab), Media, Theme (Colors, Typography, Appearance,
288
+ Identity, Brand assets), and Users (Users, Roles). Features itself is
289
+ not a row. A site may pass `extras` into `createFeatures` — those rows
290
+ appear only there. `canUseFeature(slug)` is true when the row is
291
+ released and a held role is granted it, or when the login is Developer.
292
+ An empty Global falls back to the catalogue defaults. Group slugs
293
+ `pages` and `theme` are true when any child is. `createPages` /
294
+ `createMedia` use `canUseFeature` for create and update (and
295
+ `admin.hidden`). Theme and brand-assets still take `access` arguments —
296
+ pass `canUseFeature("theme")` / `canUseFeature("brand-assets")` as
297
+ `update`.
291
298
 
292
299
  ```ts
293
300
  createFeatures({
294
- extras: [{ slug: "doctors", label: "Doctor search" }],
301
+ extras: [{ slug: "doctors", label: "Doctor search", group: "users" }],
295
302
  });
296
303
  ```
297
304