You are here

function UserPermissionsForm::submitForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/user/src/Form/UserPermissionsForm.php \Drupal\user\Form\UserPermissionsForm::submitForm()

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides FormInterface::submitForm

File

core/modules/user/src/Form/UserPermissionsForm.php, line 203
Contains \Drupal\user\Form\UserPermissionsForm.

Class

UserPermissionsForm
Provides the user permissions administration form.

Namespace

Drupal\user\Form

Code

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));
  }
  drupal_set_message($this
    ->t('The changes have been saved.'));
}