diff --git a/src/Access/UwNodeAccessCheck.php b/src/Access/UwNodeAccessCheck.php index ff846aaa46735c9c017f334e94292503c4e343b0..ed445b7036a6f877285d232ec9ce64c549367c27 100644 --- a/src/Access/UwNodeAccessCheck.php +++ b/src/Access/UwNodeAccessCheck.php @@ -77,6 +77,12 @@ class UwNodeAccessCheck implements AccessInterface { return AccessResult::forbidden(); } + // The Expand/collapse group nodes should only be visible if the logged-in + // users have 'Expand/collapse group: Edit any content' permission. + if ($node && $node->bundle() == 'uw_ct_expand_collapse_group' && !$account->hasPermission('edit any uw_ct_expand_collapse_group content')) { + return AccessResult::forbidden(); + } + // We have to return some type of access, so we are going to return // allowed, if they do not have access, the new exception is going to be // thrown above.