public function Role::validateOptionsForm

Provide the default form form for validating options

Overrides AccessPluginBase::validateOptionsForm

File

drupal/core/modules/user/lib/Drupal/user/Plugin/views/access/Role.php, line 82
Definition of Drupal\user\Plugin\views\access\Role.

Class

Role
Access plugin that provides role-based access control.

Namespace

Drupal\user\Plugin\views\access

Code

public function validateOptionsForm(&$form, &$form_state) {
  if (!array_filter($form_state['values']['access_options']['role'])) {
    form_error($form['role'], t('You must select at least one role if type is "by role"'));
  }
}