chg: [cleanup] of the default role setting for keycloak
- not used in any sensible way anymorecli-modification-summary
parent
260e1d30a1
commit
5c02f1c6a4
|
@ -145,9 +145,6 @@ class AuthKeycloakBehavior extends Behavior
|
||||||
$roleConditions = [
|
$roleConditions = [
|
||||||
'id' => $data['role_id']
|
'id' => $data['role_id']
|
||||||
];
|
];
|
||||||
if (!empty(Configure::read('keycloak.user_management.actions'))) {
|
|
||||||
$roleConditions['name'] = Configure::read('keycloak.default_role_name');
|
|
||||||
}
|
|
||||||
$user = [
|
$user = [
|
||||||
'username' => $data['username'],
|
'username' => $data['username'],
|
||||||
'disabled' => false,
|
'disabled' => false,
|
||||||
|
|
|
@ -208,27 +208,6 @@ class CerebrateSettingsProvider extends BaseSettingsProvider
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
'keycloak.authoritative' => [
|
|
||||||
'name' => 'Authoritative',
|
|
||||||
'type' => 'boolean',
|
|
||||||
'severity' => 'info',
|
|
||||||
'description' => __('Override local role and organisation settings based on the settings in KeyCloak'),
|
|
||||||
'default' => false,
|
|
||||||
'dependsOn' => 'keycloak.enabled'
|
|
||||||
],
|
|
||||||
'keycloak.default_role_name' => [
|
|
||||||
'name' => 'Default role',
|
|
||||||
'type' => 'select',
|
|
||||||
'severity' => 'info',
|
|
||||||
'description' => __('Select the default role name to be used when creating users'),
|
|
||||||
'options' => function ($settingsProviders) {
|
|
||||||
$roleTable = TableRegistry::getTableLocator()->get('Roles');
|
|
||||||
$allRoleNames = $roleTable->find()->toArray();
|
|
||||||
$allRoleNames = array_column($allRoleNames, 'name');
|
|
||||||
return array_combine($allRoleNames, $allRoleNames);
|
|
||||||
},
|
|
||||||
'dependsOn' => 'keycloak.enabled'
|
|
||||||
],
|
|
||||||
'keycloak.screw' => [
|
'keycloak.screw' => [
|
||||||
'name' => 'Screw',
|
'name' => 'Screw',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
|
|
|
@ -245,10 +245,6 @@ class UsersTable extends AppTable
|
||||||
{
|
{
|
||||||
$role = $this->Roles->find()->where(['name' => $user['role']['name']])->first();
|
$role = $this->Roles->find()->where(['name' => $user['role']['name']])->first();
|
||||||
if (empty($role)) {
|
if (empty($role)) {
|
||||||
if (!empty(Configure::read('keycloak.default_role_name'))) {
|
|
||||||
$default_role_name = Configure::read('keycloak.default_role_name');
|
|
||||||
$role = $this->Roles->find()->where(['name' => $default_role_name])->first();
|
|
||||||
}
|
|
||||||
if (empty($role)) {
|
if (empty($role)) {
|
||||||
throw new NotFoundException(__('Invalid role'));
|
throw new NotFoundException(__('Invalid role'));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue