Created
April 25, 2024 00:32
-
-
Save ahebrank/f45febf3767bdc68fda1b453afe2e1ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/vapn.module b/vapn.module | |
index ffcc861..35bb5ce 100644 | |
--- a/vapn.module | |
+++ b/vapn.module | |
@@ -70,6 +70,12 @@ function vapn_node_access(NodeInterface $entity, $operation, AccountInterface $a | |
$rid = $item->target_id; | |
$allowed_roles[$rid] = $rid; | |
} | |
+ | |
+ // Nothing marked on a node? Allow by default. | |
+ if (empty($allowed_roles)) { | |
+ return AccessResult::neutral(); | |
+ } | |
+ | |
$access_result = array_intersect($account->getRoles(), $allowed_roles) | |
? AccessResult::allowed() | |
: AccessResult::forbidden(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment