Skip to content
Snippets Groups Projects
Commit 7a9b913f authored by Viktor Holovachek's avatar Viktor Holovachek
Browse files

Issue #3471588 - Add new permission

parent dedb6c2e
Branches
No related tags found
1 merge request!8Issue #3471588 - Add new permission
fapiv access example page:
title: 'Access an example page'
description: 'Allows a user to access an example page.'
...@@ -4,4 +4,4 @@ fapiv_example.simple_form: ...@@ -4,4 +4,4 @@ fapiv_example.simple_form:
_title: 'FAPI Validation Form Example' _title: 'FAPI Validation Form Example'
_form: '\Drupal\fapiv_example\Form\SimpleForm' _form: '\Drupal\fapiv_example\Form\SimpleForm'
requirements: requirements:
_permission: 'access content' _permission: 'fapiv access example page'
...@@ -41,6 +41,7 @@ class SimpleForm extends FormBase { ...@@ -41,6 +41,7 @@ class SimpleForm extends FormBase {
'#description' => $this->t('The Value should be JonhDoe.'), '#description' => $this->t('The Value should be JonhDoe.'),
'#validators' => [ '#validators' => [
['rule' => 'length[7]', 'error' => 'Wrong name size of field %field.'], ['rule' => 'length[7]', 'error' => 'Wrong name size of field %field.'],
'custom_validator',
], ],
'#required' => TRUE, '#required' => TRUE,
]; ];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment