Loading ui_examples.install 0 → 100644 +20 −0 Original line number Diff line number Diff line <?php /** * @file * Installation file for UI Examples module. */ declare(strict_types = 1); /** * Add new permission to access the library to all roles. */ function ui_examples_update_8101(): void { $roles = \user_roles(); if (!empty($roles)) { foreach (\array_keys($roles) as $rid) { \user_role_grant_permissions($rid, ['access_ui_examples_library']); } } } ui_examples.permissions.yml 0 → 100644 +2 −0 Original line number Diff line number Diff line access_ui_examples_library: title: 'Access examples library' ui_examples.routing.yml +2 −4 Original line number Diff line number Diff line Loading @@ -4,8 +4,7 @@ ui_examples.overview: _controller: '\Drupal\ui_examples\Controller\ExamplesLibraryController::overview' _title: 'Examples library' requirements: # Currently no need to filter access on the example pages. _access: 'TRUE' _permission: 'access_ui_examples_library' ui_examples.single: path: '/examples/{name}' Loading @@ -13,5 +12,4 @@ ui_examples.single: _controller: '\Drupal\ui_examples\Controller\ExamplesLibraryController::single' _title_callback: '\Drupal\ui_examples\Controller\ExamplesLibraryController::title' requirements: # Currently no need to filter access on the example pages. _access: 'TRUE' _permission: 'access_ui_examples_library' Loading
ui_examples.install 0 → 100644 +20 −0 Original line number Diff line number Diff line <?php /** * @file * Installation file for UI Examples module. */ declare(strict_types = 1); /** * Add new permission to access the library to all roles. */ function ui_examples_update_8101(): void { $roles = \user_roles(); if (!empty($roles)) { foreach (\array_keys($roles) as $rid) { \user_role_grant_permissions($rid, ['access_ui_examples_library']); } } }
ui_examples.permissions.yml 0 → 100644 +2 −0 Original line number Diff line number Diff line access_ui_examples_library: title: 'Access examples library'
ui_examples.routing.yml +2 −4 Original line number Diff line number Diff line Loading @@ -4,8 +4,7 @@ ui_examples.overview: _controller: '\Drupal\ui_examples\Controller\ExamplesLibraryController::overview' _title: 'Examples library' requirements: # Currently no need to filter access on the example pages. _access: 'TRUE' _permission: 'access_ui_examples_library' ui_examples.single: path: '/examples/{name}' Loading @@ -13,5 +12,4 @@ ui_examples.single: _controller: '\Drupal\ui_examples\Controller\ExamplesLibraryController::single' _title_callback: '\Drupal\ui_examples\Controller\ExamplesLibraryController::title' requirements: # Currently no need to filter access on the example pages. _access: 'TRUE' _permission: 'access_ui_examples_library'