Skip to content
Snippets Groups Projects
Commit ac3678e9 authored by Steven Ayers's avatar Steven Ayers
Browse files

Issue #3473842: Governance setting roles should be inclusive

parent 8323fc48
Branches
Tags
1 merge request!6Issue #3473842 by bluegeek9: Governance setting roles should be inclusive
Pipeline #281211 failed
roles:
exclude:
anonymous: anonymous
authenticated: authenticated
roles: { }
......@@ -99,9 +99,6 @@ knowledge.governance.settings:
label: 'governance settings'
mapping:
roles:
type: mapping
mapping:
exclude:
type: sequence
sequence:
type: string
......
......@@ -69,10 +69,10 @@ final class GovernanceForm extends ConfigFormBase {
foreach ($roles as $machine_name => $role) {
$options[$machine_name] = $role->label();
}
$form['exclude'] = [
'#type' => 'select',
'#title' => $this->t('Exclude'),
'#default_value' => $settings->get('roles.exclude'),
$form['roles'] = [
'#type' => 'checkboxes',
'#title' => $this->t('When the user has one of these roles'),
'#default_value' => $settings->get('roles') ?? [],
'#options' => $options,
'#multiple' => TRUE,
];
......@@ -86,7 +86,7 @@ final class GovernanceForm extends ConfigFormBase {
public function submitForm(array &$form, FormStateInterface $form_state): void {
$this->config('knowledge.governance.settings')
->set('roles.exclude', $form_state->getValue('exclude'))
->set('roles', $form_state->getValue('roles'))
->save();
parent::submitForm($form, $form_state);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment