I am trying to restrict the results of a View to only the Node(s) the User has the same Taxonomy assignment.

Users:
UserA: Team1, Team2, Team3
UserB: Team3
UserC: Team4

Nodes:
Node1: Team3
Node2: Team4
Node3: Team1

Views Results:
If you have been assigned a TeamX, you will see the Nodes assigned with NodeX.

UserC can see nodes with Team4 which is Node2
UserA can see nodes with Team1,Team2,Team3 which are Node1 and Node3

Ideas? I am off base here?

Thanks

Comments

joachim’s picture

Category: support » feature

You'd need some new components in Views.

Possibly:

- a new taxonomy from current user default argument plugin
- use the existing current user plugin, and a relationship to user terms, and a relationship from term to nodes (not sure either of the last two exist).

Not something I have time to work on, but I'll review and commit a patch :)

oligodosh’s picture

I have exactly the same need and I've been trying to find a solution using the regular Views interface without any success at all. To sum up with:
- I created a relationship to the User Terms table using this method: http://drupal.org/node/696210, but I don't know which user's User Terms it is linked to, i.e. the current user or the user who created the node?
- I tried to pass in the current user ID using the Arguments settings
- I tried all sort of combinations in the Filters settings without being able to get any result.

Now to add to newmember's post I think that the requested algorithm would be:
- get the current user's term
- display all nodes which terms contain at least one of the current user's term.

Maybe some Views expert could provide some clue on this.

Thanks

joachim’s picture

I thought I did, in comment #1 above.