Hello there,i have a question.
How can i make default language XXX and user role XXX while creating user in panel.
Thanks good works!
You can set a default role in `/site/roles, e.g. editor.php
<?php
return [
'name' => 'Editor',
'default' => true,
'permissions' => [
...
]
];
https://getkirby.com/docs/panel/roles
Then this roles will always be used as the default.
You can also define a default panel language: c::set(‘panel.language’, ‘en’); This should then apply to all users as default.
c::set(‘panel.language’, ‘en’);
Thanks this code worked for default language.
But this default role;
site/config/config.php
c::set(‘roles’, [
[
‘id’ => ‘admin’,
‘name’ => ‘Admin’,
‘default’ => true,
‘panel’ => true
],
[
‘id’ => ‘editor’,
‘name’ => ‘Editor’,
‘panel’ => true
],
[
‘id’ => ‘client’,
‘name’ => ‘Client’,
‘default’ => true,
‘panel’ => false
]
]);
Its not work client default
Hint:
You can use only ONCE:
Good luck!
The default role can only be set for a single user role, not for several ones, set it only for the client, not for the admin user.
Do not set 'default' => true
for the admin user, anyway, as you might create unwanted admins.
Haha to be honest i dont attention to see that admin default, sorry.
Thanks!