Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / node / tests / modules / node_access_test / node_access_test.module
index 40baeb53edede3092bd29f2ec815ee8f5d45b5b6..5a9756b51adc8f80b58fab29aadb3a6b71aff342 100644 (file)
@@ -152,6 +152,12 @@ function node_access_test_node_access(NodeInterface $node, $op, AccountInterface
     // Make all Catalan content secret.
     return AccessResult::forbidden()->setCacheMaxAge(0);
   }
+
+  // Grant access if a specific user is specified.
+  if (\Drupal::state()->get('node_access_test.allow_uid') === $account->id()) {
+    return AccessResult::allowed();
+  }
+
   // No opinion.
   return AccessResult::neutral()->setCacheMaxAge(0);
 }