Skip to content

Commit

Permalink
Merge pull request #640 from Gizra/fix-main-settings-check
Browse files Browse the repository at this point in the history
Fixed main settings check
  • Loading branch information
balagan73 authored Mar 11, 2024
2 parents 81d54c9 + c74a9fd commit 8381aac
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions web/modules/custom/server_general/server_general.module
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,10 @@ function server_general_node_access(NodeInterface $entity, string $op, AccountIn
}

$main_settings = server_general_get_main_settings();
if (!$main_settings instanceof ConfigPages) {
AccessResult::neutral();
}
// Add cache tags to the cache metadata.
$cache_tags = $main_settings->getCacheTags();

if ($op === 'delete' && server_general_is_node_locked($entity)) {
if ($op === 'delete' && $main_settings instanceof ConfigPages && server_general_is_node_locked($entity)) {
// Add cache tags to the cache metadata.
$cache_tags = $main_settings->getCacheTags();
return AccessResult::forbidden()->addCacheableDependency($entity)->addCacheTags($cache_tags);
}

Expand Down

0 comments on commit 8381aac

Please sign in to comment.