Hello, I’m trying to load a different variant of a user blueprint for admins.
I thought I would follow this article (https://getkirby.com/docs/cookbook/extensions/permission-tricks#load-single-different-blueprints-per-user-role) to achieve my goal. Unfortunately that doesn’t work.
My Code:
<?php
use Kirby\Cms\App as Kirby;
if(($user = kirby()->user()) && $user->role()->name() === 'admin') {
$dir = __DIR__ . '/blueprints/users/admin/member.yml';
} else {
$dir = __DIR__ . '/blueprints/users/member.yml';
}
Kirby::plugin('cookbook/role-blueprints', [
'blueprints' => [
'users/member' => $dir
]
]);
As soon as I remove the member.yml file from the users directory, it is no longer possible to create new users with this role via the panel.
I’ve tried different variants but so far nothing has been successful.
Any help, please.
Thanks!