Skip to content
Snippets Groups Projects
Commit 52567594 authored by Lily Yan's avatar Lily Yan Committed by Kevin Paxman
Browse files

ISTWCMS-6009 Remove 'entity.node.delete_form' in UwNodeAccessCheck.php

parent 0a3eb6f2
No related branches found
No related tags found
1 merge request!317ISTWCMS-6009 Use prevent_homepage_deletion module
......@@ -7,7 +7,6 @@ use Drupal\Core\Routing\Access\AccessInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\menu_admin_per_menu\Access\MenuAdminPerMenuAccess;
use Drupal\uw_cfg_common\Service\UWService;
/**
* Checks access for displaying configuration translation page.
......@@ -38,15 +37,6 @@ class UwNodeAccessCheck implements AccessInterface {
$menu_admin_per_menu = new MenuAdminPerMenuAccess();
return $menu_admin_per_menu->menuLinkAccess($account, $menu_link_plugin);
// Node delete pages.
case 'entity.node.delete_form':
$node = $route_match->getParameter('node');
// Only those with permission may delete the home page.
if ($node && UWService::nodeIsHomePage((int) $node->id())) {
return $account->hasPermission('bypass home page protection') ? AccessResult::allowed() : AccessResult::forbidden();
}
return AccessResult::allowed();
// Dashboard config: admin/config/dashboards/dashboardssettings.
case 'dashboards.dashboards_settings_form':
return $account->hasPermission('access dashboard config') ? AccessResult::allowed() : AccessResult::forbidden();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment