We would like to restrict access to posts (inbuild & custom posts) based on the taxonomy term selected.
Eg only user role 'directors' can view posts that have taxonomy term 'financials' selected.
Toolset Access Taxonomy controls do not allow control over who can see what related to the Posts tagged with Terms from those Taxonomies, instead, it allows to control who can Manage terms (access the taxonomy terms list), Edit terms (edit any term), Delete terms (delete terms) and Assign terms (assign terms to their respective post types).
https://toolset.com/documentation/user-guides/setting-access-control/#taxonomy
Hence, to hide Posts from either an Archive List or a View Loop or in single templates, you'll have to fall back to the following resources, which are Access ShortCodes and HTML Conditions.
1. HTML Conditions will help you determine what precise tag is assigned to the current post, whether in a Loop of any kind or on a single Post template. The general syntax to check whether a post has or has not a given term assigned is:
[wpv-conditional if="( CONTAINS(#(taxonomy-slug),'term-slug') )"]
<p>This consultant speaks Chinese!</p>
[/wpv-conditional]
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/, https://toolset.com/documentation/user-guides/conditional-html-output-in-views/displaying-taxonomies-conditionally/
2. Toolset Access ShortCodes allow to hide or show content based on User Roles (HTML Conditions can do that too, BTW). THe general syntax is:
[toolset_access role="Author" operator="deny"]cannot see[/toolset_access]
https://toolset.com/documentation/user-guides/access-control-texts-inside-page-content/
Now, to dynamically control this without the need to edit every single post, you could:
- apply a Content Template to the single posts so you need to set the Rules only once in the Content Template
- Use Views or Archive Loops to display many posts and control the output with the above-explained tools inside the Loop, so it applies to each post in the loop.