Panel area only for admins

Hi there,

Can I make a custom panel area (“dashboard”) only visible for accounts with the admin role? The other roles (Editor, Viewer, …) should not have access to the dashboard. Preferably I would just hide the sidebar menu item “Dashboard”.

Is this possible?

Have you tried access permissions in the user role blueprints for non-admins?

If that doesn’t work, you could hide the menu item based on role in your custom area und do a redirect in the route action to prevent direct access to the path for non-admin roles

How do you hide a menu item based on your role?

Have you tried the permission access option I linked to? Should work.

I have the same question for my plugin GitHub - leobard/deploy-yourself: A script to update a kirby website code (not content) by pulling from git.

I would also like to “hide the menu item based on role in your custom area”.

And I hoped it would be

Kirby::plugin('leobard/deploy-yourself', [
'areas' => function () => {
  if(kirby()->user()?->role() == 'admin') return [
     ...area goes here
  ]
]);

I found Permissions | Kirby CMS not immediately intuitive to use, as I would have to remove access to the area of my plugin for all multiple non-admin roles.