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:
Home option
When a user logs in to the Panel, they normally get redirected to the last view they were on before they were logged out or the Site view. When you work with permissions, you might want to block the Site view or redirect the user to a completely different view instead. This is now possible with the new home
option for user blueprints. This way you can define the redirect for each role individually. Redirects can be simple paths or dynamic locations via string queries.
Simple paths
Queries to panel views
Queries to pages
Image options
The image options for users can now be defined directly in their own blueprint. This significantly simplifies the setup of sections as they all inherit the image settings. You can still set image settings in sections the good old way if needed.
Support for queries
Panel preview image options now all support our powerful queries:
Custom colors
back
and color
options for Panel preview images now support shorthands for core CSS color variables as well as HEX codes or other native CSS color properties (e.g. even gradients):
CSS color property shorthands
Check out the list of our color properties for available options.
Hex codes
CSS rules
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 |
---|---|
account |
true /false |
panel |
true /false |
users |
true /false |
site |
true /false |
system |
true /false |
languages |
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.