Skip to content

Kirby 3.5.7.1

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

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

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.