fendinger/kirby-roles

A Kirby CMS Panel plugin that adds a Roles menu item for managing user roles directly from the Panel

Maintainers

Package info

github.com/fendinger/kirby-roles

Type:kirby-plugin

pkg:composer/fendinger/kirby-roles

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-04-15 19:35 UTC

This package is auto-updated.

Last update: 2026-04-15 19:50:36 UTC


README

Kirby Roles

Kirby Roles

A Kirby 5 Panel plugin that adds a Roles menu item for managing user roles directly from the Panel. Create, edit, and delete roles with a visual permissions editor — no more manually editing YAML files.

Features

  • Panel area with dedicated "Roles" menu item
  • List view of all roles with icons and context menus
  • Detail view with profile card (like the user view) and permissions editor
  • CRUD — create, edit, and delete roles via dialogs
  • Permissions editor using Kirby's native checkbox fields
  • Save/Cancel using Kirby's standard k-form-controls component
  • Settings button (cog icon) with edit/delete dropdown
  • Pencil on hover for quick title editing (like pages/users)
  • Protectionadmin and nobody roles cannot be modified or deleted
  • Safety check — roles with assigned users cannot be deleted
  • Admin only — only admin users can manage roles
  • i18n — English and German translations included
  • Dark mode compatible

Installation

Composer

composer require fendinger/kirby-roles

Manual

Download and copy this repository to /site/plugins/kirby-roles.

Menu position

By default, the Roles menu item appears after the System entry. To place it above Users, add this to your site/config/config.php:

return [
    'panel' => [
        'menu' => ['site', 'languages', 'roles', 'users', 'system']
    ]
];

How it works

Roles in Kirby are defined as YAML blueprint files in site/blueprints/users/. This plugin provides a Panel UI to manage these files:

  • Creating a role generates a new site/blueprints/users/{name}.yml file
  • Editing updates the title, description, and permissions in that file
  • Deleting removes the YAML file (only if no users are assigned to the role)

The admin role is built into Kirby and always exists, even without a blueprint file. It cannot be edited or deleted through this plugin.

API routes

The plugin also registers API routes for programmatic access:

Method Pattern Description
GET /api/roles List all roles
GET /api/roles/{id} Get a single role
POST /api/roles Create a new role
PATCH /api/roles/{id} Update a role
DELETE /api/roles/{id} Delete a role

Translations

The plugin ships with English and German translations. To add another language, create a new file in translations/ and reference it in index.php:

'translations' => [
    'en' => require __DIR__ . '/translations/en.php',
    'de' => require __DIR__ . '/translations/de.php',
    'fr' => require __DIR__ . '/translations/fr.php',
],

Support

If you find this plugin useful, you can support the development:

Buy Me A Coffee

License

MIT

Author

fendinger.de