I am using Views and Taxonomy Access Control for building an intranet site. I have a controlled taxonomy vocabulary with one term for each department of a company and every node must have at least one term in this vocabulary. I am using the "taxonomy_term" view to get page views with node lists filtered by the argument taxonomy term id. So far everything works fine.

There is one thing I am not sure if it is possible: I made a custom menu where each menu item is one of the terms of my department vocabulary and has a path to the taxonomy_term view appending the term-id (resulting in a path like like views/taxonomy/term/58). If the active user has no permission to see nodes with term-id=58, I get an empty view. This is correct but I would prefer that this menu item is not shown to this user at all because TAC does not allow his role(s) to access the result of the taxonomy_term view.

I think a possible solution would be if I could use some PHP code for setting Access in the view definition dynamically in evaluating which roles are allowed to access the term given in view's argument.

Is there a way to achieve this?

I know there is a workaround to get what I want: I have to clone the view taxonomy_term for each term in my vocabulary. Then I am able to set the role access permission in each of the cloned views as I need to control the visibility of the menu items. But as I do have 60 terms I have to use 60 cloned views and if I nedd to modify the view settings I have to do this in each of those 60 views...

Comments

rod.murphy’s picture

Not sure if you found any solution to this (either way, at this stage it's probably too late for the op) but I am looking for a solution to this problem too. I came across this article which might help anyone else who comes across this post.

http://www.johnandcailin.com/blog/cailin/advanced-drupal-views-access-co...

But, the proposed solution involves making changes to the views module. It mightn't be too hard to add a text box to add php code to provide the access function, you were asking for.

sun’s picture

Status: Active » Closed (won't fix)

Sorry, Views 1.x will not have any new major features. Consider upgrading to 6.x, please.