Skip to content
Snippets Groups Projects
Commit bf53a129 authored by Florent Torregrosa's avatar Florent Torregrosa
Browse files

Issue #3480553 by grimreaper, pdureau: UI Patterns: change libraries paths +...

Issue #3480553 by grimreaper, pdureau: UI Patterns: change libraries paths + update library permission
parent 56e86dc6
No related branches found
No related tags found
1 merge request!242Issue #3480553 by grimreaper: UI Patterns: change libraries paths
Pipeline #312769 canceled
......@@ -4,7 +4,7 @@ ui_patterns_devel.twig_validator:
_title: "Components status report"
_controller: '\Drupal\ui_patterns_devel\Controller\ComponentValidatorOverview::overview'
requirements:
_permission: "access patterns page+access site reports"
_permission: "access components page+access site reports"
ui_patterns_devel.twig_validator.details:
path: "/admin/reports/ui-components/details"
......@@ -12,7 +12,7 @@ ui_patterns_devel.twig_validator.details:
_title: "Components status report"
_controller: '\Drupal\ui_patterns_devel\Controller\ComponentValidatorOverview::overviewDetails'
requirements:
_permission: "access patterns page+access site reports"
_permission: "access components page+access site reports"
ui_patterns_devel.twig_validator.component:
path: "/admin/reports/ui-components/component/{component_id}"
......@@ -21,4 +21,4 @@ ui_patterns_devel.twig_validator.component:
_controller: '\Drupal\ui_patterns_devel\Controller\ComponentValidatorOverview::overviewSingle'
component_id: ""
requirements:
_permission: "access patterns page+access site reports"
_permission: "access components page+access site reports"
<?php
/**
* @file
* Contains ui_patterns_library.install.
*/
declare(strict_types=1);
/**
* Update permission.
*/
function ui_patterns_library_update_10201(): void {
if (\Drupal::moduleHandler()->moduleExists('user')) {
/** @var \Drupal\user\RoleInterface[] $roles */
$roles = \Drupal::entityTypeManager()->getStorage('user_role')
->loadMultiple();
foreach ($roles as $role) {
if ($role->hasPermission('access patterns page')) {
$role->revokePermission('access patterns page');
$role->grantPermission('access components page');
$role->trustData()->save();
}
}
}
}
access patterns page:
access components page:
title: "Access library page"
ui_suite.index:
path: "/admin/appearance/ui-libraries"
path: "/admin/appearance/ui"
defaults:
_controller: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage'
_title: "UI libraries"
requirements:
_permission: "access patterns page+access_ui_styles_library+access_ui_examples_library"
_permission: "access components page+access_ui_styles_library+access_ui_examples_library+access ui icons library"
ui_patterns_library.overview:
path: "/patterns"
path: "/admin/appearance/ui/components"
defaults:
_controller: '\Drupal\ui_patterns_library\Controller\LibraryController::overview'
_title: "Components library"
requirements:
_permission: "access patterns page"
_permission: "access components page"
options:
_admin_route: FALSE
ui_patterns_library.provider:
path: "/patterns/{provider}"
path: "/admin/appearance/ui/components/{provider}"
defaults:
_controller: '\Drupal\ui_patterns_library\Controller\LibraryController::provider'
_title_callback: '\Drupal\ui_patterns_library\Controller\LibraryController::providerTitle'
requirements:
_permission: "access patterns page"
_permission: "access components page"
options:
_admin_route: FALSE
ui_patterns_library.single:
path: "/patterns/{provider}/{machineName}"
path: "/admin/appearance/ui/components/{provider}/{machineName}"
defaults:
_controller: '\Drupal\ui_patterns_library\Controller\LibraryController::single'
_title_callback: '\Drupal\ui_patterns_library\Controller\LibraryController::title'
requirements:
_permission: "access patterns page"
_permission: "access components page"
options:
_admin_route: FALSE
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment