Set Custom Permissions
For default roles and permission, refer to Roles and Permissions
Custom Roles
The Dashboard allows you to create custom Roles, which can be assigned to Users and used to define custom Permissions.
Custom Permissions
Custom permissions are defined using the permissions
object in the React Bricks configuration.
Permissions are implemented by providing one of more permission functions.
The available permission functions are:
canAddPage: (user, pageType) => boolean
canAddTranslation: (user, pageType, language) => boolean
canSeePageType: (user, pageType) => boolean
canSeePage: (user, page) => boolean
canEditPage: (user, page) => boolean
canDeletePage: (user, page) => boolean
canDeleteTranslation: (user, page) => boolean
canUseBrick: (user, brick) => boolean
The complete description of the Permissions
type is as follows:
Usage Example
Let’s say we’ve created the custom roles blog_editor
and translator_fr
in the dashboard.
Now, we’ll create two permission rules:
- Prevent all editors from adding
institutional
pages and restrictblog_editor
users to adding only pages of typeblog
. - Prevent
French translators
from deleting translations in languages other thanFrench
.