Hello there,
often times I create Kirby projects with user roles that have different permissions and blueprints in mind.
An admin can create pages and assign them to users with the role ‘editor’. The editor can only see and edit the pages that are assigned to them in the panel, nothing else.
I use these proposed solutions for that:
User blueprints and panel permissions
User permisions for specific page and it’s subpages
It all seems to work fine, but some clients tell me that their site is unresponsive from time to time. Because there was never an error thrown, i nearly went crazy searching for the solution, because i dont know how to debug such a thing in php.
Today, i think i found the cause in the custom plugin i use
<?php
if(($user = kirby()->user()) && $user->role() == 'diver') {
$dir = __DIR__. '/blueprints/editor/';
} else {
$dir = __DIR__ . '/blueprints/admin/';
}
Kirby::plugin('dodo/user-roles', [
$kirby = new Kirby([
'roots' => [
'blueprints' => $dir,
],
])
]);
With the plugin installed, as a user tries to logout of the Panel, the menubar disappears and everything freezes. Sometimes it doesnt even work to go back to the homepage and a 504 Gateway-Timeout error is thrown.
For testing purposes i set up a fresh starterkit installation with just the user-role plugin installed. Same problem.
https://userroles.4lima.de/
panel access:
user: admin@user.de
pass: 12345678
If someone could point me in the right direction, it would be highly appreciated.
Kind regards,
Dodo