Skip to content

Instantly share code, notes, and snippets.

@imcbride
Created July 2, 2021 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imcbride/4dbf34ba841da5dd88e8439654c00cd4 to your computer and use it in GitHub Desktop.
Save imcbride/4dbf34ba841da5dd88e8439654c00cd4 to your computer and use it in GitHub Desktop.
tvi-views-access.patch
diff --git a/src/Service/TaxonomyViewsIntegratorManager.php b/src/Service/TaxonomyViewsIntegratorManager.php
index 23f6dd9..fd2f47e 100644
--- a/src/Service/TaxonomyViewsIntegratorManager.php
+++ b/src/Service/TaxonomyViewsIntegratorManager.php
@@ -153,6 +153,13 @@ class TaxonomyViewsIntegratorManager implements TaxonomyViewsIntegratorManagerIn
->view($taxonomy_term, 'full');
}
+ // @todo: Access-control, is it worth addressing?
+ if (!$build['#view'] || !$build['#view']->access($build['#view']->current_display)) {
+ // here we return a 403
+ // you might advise to use views_embed_view
+ throw new AccessDeniedHttpException();
+ }
+
return $build;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment