I have one general taxonomy view wich has this alias mask /taxonomy/term/%.

What I need is to hide views for certain taxonomy terms like 'canada' from display while it'll remain showing the other ones the same way it was before.

New contributor
Alexander Y is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • Do you only want to control who can see certain pages, or do you want to disable that path for certain terms overall? – prkos Nov 10 at 19:49
  • @prkos I would like to hide article teasers from users by role for certain taxonomy term. And if it's not possible, disabling path for terms would be fine too. – Alexander Y Nov 10 at 20:40

Out of the box Views only has 2 different types of access management:

  • Via role
  • Via permission

However, it's an all-or-nothing control; you can't do it on a per contextual argument basis (for a taxonomy in your /taxonomy/term/% view).

What you can do, is create your own Views access plugin (or perhaps one already exists, look through drupal.org for 8.x Views projects). Take a look at the access plugin code docs or this tutorial as primer on how this is done.

Although you could edit the existing views and with some effort split the display into more than one page that would address each of the special terms individually it's not the most convenient way to go.

There are modules that can help you get there: Permissions by Term. It doesn't only restrict access of the taxonomy term pages but the nodes as well. There is a documentation page with more information: Documentation: Permissions by Term.

If that doesn't help then try Taxonomy Permissions (not quite D8 ready) and/or Taxonomy access fix.

Your Answer

Alexander Y is a new contributor. Be nice, and check out our Code of Conduct.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.