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
- /site/blueprints/users
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.
- /site/blueprints/users/default.yml
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:
title: Client
description: The client can edit all pages
Translated titles
Title and description can be translated by passing an array of translations with the matching language code as key:
title:
en: Client
de: Kunde
description:
en: The client can edit all pages
de: Der Kunde kann alle Seiten bearbeiten
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
title: Editor
home: /panel/account
Queries to panel views
title: Editor
home: "{{ site.find('blog').children.first.panel.url }}"
Queries to pages
title: Editor
home: "{{ site.find('blog').children.first.url }}"
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.
image:
back: blue-200
icon: 📝
Support for queries
Panel preview image options now all support our powerful queries:
image:
back: "{{ user.myCustomBackColor }}"
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
image:
back: "purple-400"
Check out the list of our color properties for available options.
Hex codes
image:
back: "#ff0000"
CSS rules
image:
back: "linear-gradient(90deg, rgba(2,0,36,1) 0%, rgba(9,9,121,1) 35%, rgba(0,212,255,1) 100%);"
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
permissions:
access:
settings: false
users: false
files
Option | Value |
---|---|
changeName |
true /false |
create |
true /false |
delete |
true /false |
replace |
true /false |
update |
true /false |
Example: Prevent deleting files
permissions:
files:
delete: false
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
permissions:
pages:
delete: false
create: false
changeTemplate: false
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.
users: false
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:
permissions:
access:
users: true
users:
delete: false
create: false
changeRole: false
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.
permissions:
access:
users: true
users: false
user:
delete: false
changeRole: false
Using wildcards
It's also possible to restrict access to entire blocks by just passing false
to the block:
permissions:
pages: false
Examples
You can find examples of user blueprints in the samples section.