Roles

Learn how to setup different user roles

Kirby's new user management is based on a simple role system. Per default Kirby is configured to provide two roles:

Roles can be set in the Users section of the panel.

The Admin role is mandatory and cannot be removed. Users with this role can create new users, edit and delete all user accounts. Users with any other role are only allowed to edit their own user data and cannot delete other accounts.

You can create your own roles in /site/config/config.php

Setup

c::set('roles', array(
  array(
    'id'      => 'admin',
    'name'    => 'Admin',
    'default' => true,
    'panel'   => true
  ),
  array(
    'id'      => 'editor',
    'name'    => 'Editor',
    'panel'   => true
  ),
  array(
    'id'      => 'client',
    'name'    => 'Client',
    'panel'   => false
  )
));

default option

The default option determines, which role is being selected by default when a new user is being created.

panel option

As you can see in the example above it is possible to set the panel option to true or false. By setting it to false you can create users, which can't login to the panel, but you can still provide a login and access for them to different parts of your website with the $user API.

This entirely replaces the auth plugin functionality from Kirby 1. All panel and site users can be administrated from the panel, which makes the new user system very powerful.

More fine-grained permission settings are planned for future releases.