Permissions
Permissions enable the toggling of Puck features. There are three types of permissions:
- Global permissions are shared across the entire Puck application. Controlled via the permissionsprop on the<Puck>component.
- Component permissions allow feature control across for all instances of a given component type. Controlled by the permissionscomponent config API.
- Dynamic permissions enable control after each data change, and are ideal for per-instance component permissions. Controlled by the resolvePermissionscomponent config API.
APIs
Setting permissions
- Global permissionsprop
- Component permissionsparameter
- Component resolvePermissionsparameter
Extending permissions
- getPermissions
- refreshPermissions
Supported permissions
| Param | Example | Type | Default | Status | 
|---|---|---|---|---|
| delete | delete: true | Boolean | true | - | 
| drag | drag: true | Boolean | true | - | 
| edit | edit: true | Boolean | true | - | 
| insert | insert: true | Boolean | true | - | 
| ...custom | myPerm: true | Boolean | undefined | - | 
delete
Enable deletion of components.
drag
Enable component dragging. Disabling this will lock the component in place, but other components can still be dragged around it.
duplicate
Enable duplication of components.
edit
Enable field editing. This is the same as setting readOnly to true for all fields.
insert
Enable insertion of new components. Disabling this will disable the component list items.
...custom
Custom permissions enable you to control your own functionality when building custom interfaces.