function UserPermissionsForm::submitForm

Same name in other branches
  1. 9 core/modules/user/src/Form/UserPermissionsForm.php \Drupal\user\Form\UserPermissionsForm::submitForm()
  2. 10 core/modules/user/src/Form/UserPermissionsForm.php \Drupal\user\Form\UserPermissionsForm::submitForm()
  3. 11.x core/modules/user/src/Form/UserPermissionsForm.php \Drupal\user\Form\UserPermissionsForm::submitForm()

Overrides FormInterface::submitForm

File

core/modules/user/src/Form/UserPermissionsForm.php, line 214

Class

UserPermissionsForm
Provides the user permissions administration form.

Namespace

Drupal\user\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
    foreach ($form_state->getValue('role_names') as $role_name => $name) {
        user_role_change_permissions($role_name, (array) $form_state->getValue($role_name));
    }
    $this->messenger()
        ->addStatus($this->t('The changes have been saved.'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.