[Panel] How to hide links to forbidden areas for Editor-Users

Hi all,

does anyone know how to hide the links to Accounts and/or Settings in the Panel for Editor-Users?
My customers legitimately ask, why they see a link, they can’t access.
Independently of not seeing an unique identifier in those links, would it be possible to differentiate by the user-role in a custom panel-css in general?



This will be fixed in 3.6, where the link will be disabled.

thx @moonwalk, but it would be nice, if somebody knows a solution for 3.5.
also a solution for adding differnet css-rules by user-role would be very welcome :slight_smile:

I’m not aware of a solution for 3.5, unless it is possible to overwrite the topbar menu.

As regards custom Panel styles per user role, you could different stylesheets per role inside the ready config option where you have access to the Kirby user:

That is a nice option!

In a short test, i was able to hide Accounts and Settings by CSS, depending on the User Role with that.

'ready' => function ($kirby) {
        return [
            'panel' => [
                'css' => 'assets/css/panel-'. $kirby->user()->role() .'.css'
.k-panel-header .k-dropdown-content ul li:nth-child(2),
.k-panel-header .k-dropdown-content ul li:nth-child(3),
.k-site-view .k-pages-section .k-list-item-options .k-list-item-toggle {
  display: none;

Blue is Admin

Red is Editor

i was also able to hide the tools in the pages-section on the right, because the editor should not see lots of disabled buttons here too…


dirty hack!?
i dont know if i would go with that :roll_eyes:
what do you think?

if that works i have a second question:
can i have several custom panel-css-files?
i also need one depending on the environment…

Thx @texnixe

What do you mean? Depending on domain? Then you can use different config files and there define different panel stylesheets.

I’m not aware of a way to load multiple panel stylesheets, the customCSS method in the Panel class only accepts a single file that needs to exist in the file system. Would be cool if it was possible to load a dynamic stylesheet via a route in an easy way.

Would have been nice, if kirby could add several custom panel.css
one by role, one by .env / config.domain.com.php
But prerendered would works also.
Thx again for the Ready-Hint.

i dived a bit deeper in this test to add a custom-css by user-role and hide some unused links…
until now i tested with a logged in user - so on ready the user and their role is known.

but if no user is logged in, that wont work and on ‘ready’ no user is available. so no role either :frowning:

is there a possibility to add a custom-css after login?
or to write a ‘class’ to the body by js?
independently of that, does anyone knows, if there is a possibility to add css-variables to the panel?