User blueprint
User blueprints are located in /site/blueprints/users
and control the Panel setup, form fields and permissions for a user role.
Blueprint location
Default user blueprint
To create the same set of fields for all roles, you can setup a default.yml
that is used whenever no custom role blueprint is configured.
Title and description
The title is required and will appear in the list of selectable roles when a new user is created. An optional description can be displayed as well:
Translated titles
Title and description can be translated by passing an array of translations with the matching language code as key:
Permissions
The permissions
option can be used to restrict access to certain actions for the particular role. By default, all actions are allowed and you can deny them by passing false
.
access
Option | Value |
---|---|
panel |
true /false |
users |
true /false |
site |
true /false |
settings |
true /false |
Example: Prevent accessing user management and settings
files
Option | Value |
---|---|
changeName |
true /false |
create |
true /false |
delete |
true /false |
replace |
true /false |
update |
true /false |
Example: Prevent deleting files
pages
Option | Value |
---|---|
changeSlug |
true /false |
changeStatus |
true /false |
changeTemplate |
true /false |
changeTitle |
true /false |
create |
true /false |
delete |
true /false |
duplicate |
true /false |
preview |
true /false |
read |
true /false |
sort |
true /false |
update |
true /false |
Example: Prevent deleting and creating pages and changing their template
site
Option | Value |
---|---|
update |
true /false |
users
The users
setting can be set generally to false
to prevent the user from editing, adding or deleting other users.
It is also possible to set the users
options individually.
Option | Value |
---|---|
changeEmail |
true /false |
changeLanguage |
true /false |
changeName |
true /false |
changePassword |
true /false |
create |
true /false |
delete |
true /false |
update |
true /false |
Example:
user
This option refers to each user with this role.
Option | Value |
---|---|
changeEmail |
true /false |
changeLanguage |
true /false |
changeName |
true /false |
changePassword |
true /false |
changeRole |
true /false |
create |
true /false |
delete |
true /false |
update |
true /false |
Example
This user can access the user management, but not edit other users. The user cannot change their own role or delete themselves.
Using wildcards
It's also possible to restrict access to entire blocks by just passing false
to the block:
Examples
You can find examples of user blueprints in the samples section.