This module is excellent. I have one nagging curiosity however: why I am not able to use the very same Taxonomy terms I just created and simply "tag" the users?
In using Drupal 7 I am creating some views to go along with my taxonomy access. For example : a list of "Teams". I use tac_lite to define what members of those teams can see and do. Then, I wish to show lists of those teams. Great. can do that by listing terms. Say I have two teams: Red Team and Blue Team.
Then I wish to display users who belong to a team. I went to setup a view to: find users with term id = "Blue Team". The data is not stored as a term reference though. It appears to be saved in the user data blob field. Now I have to create another term reference field.
Is it possible to have the storage mechanism use taxonomy in the same way for nodes and for users? Create terms. Tag your nodes. Tag your users.
Perhaps it is not that simple? Or at least, allow a setting, or hook where I can tell the system: Also add the selected taxonomy term(s) to the user.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | tac_lite-user_term_reference-1189782.patch | 3.56 KB | svdhout |
Comments
Comment #1
Dave Cohen commentedIn D6 you could not tag users.
Do you have the PHP skills to add this feature? It would be something like this...
1. A checkbox on a tac_lite scheme page, "grant terms with which user is tagged?"
2. If checked, when computing the user's grants, include their taxonomy tags in addition to anything that might be in their data array.
Would be a nice feature!
Comment #2
quinnmerio commentedThank you, Dave - much appreciate your response to this. I will not have time to add this as a feature, unfortunately - client deadlines loom.
Comment #3
svdhout commentedI took a shot at adding this feature.
Users that have a taxonomy reference on their profile are given grants.
What i did to get it working:
Add an extra option to the scheme config
If you tick 'Use account term reference for grants.', a select box opens up.
This is used to define which term_reference will be used to assign grants from.
A function tac_lite_get_fields_for_type($entity_type, $bundle, $field_type) was created to retrieve all fields for a given entity and field_type:
Next i added the grants themself inside _tac_lite_user_tids:
While i was at it i also fixed a notice i got on the users page:
changed
to
I've created a patch using svn, so i'm not sure if it will work for git.
I got to read up on that topic
Comment #4
Drupaled-1 commentedHello,
I read this post a couple times over to make sure I understood what the request was, but I apologize if this recommendation is not exactly what you are looking. The original post references Drupal 7, but Dave's first reply references Drupal 6. My post is for anyone using Drupal 6 and needs to tag users.
The site I am currently developing also required the ability to tag the users with taxonomy terms alongside being able to use them for TAC Lite.
I found the following module developed called 'User Terms'
It is located here: http://drupal.org/project/user_terms
I hope this may help?
Comment #5
kaizerking commented@svdhout- It seems this only works for D7 core profile,can you make it for profile2 support and field collection fileds, please?
Comment #6
vladimirausThank you for contribution. 👍
Drupal 7 is no longer supported. 🤷♂️
Closing as outdated. 🔐