Hey, I have setup TAC lite to control node access by taxonomy terms. I create a taxonomy for each protocol I need to control access to, then on the user admin page under taxonomy based access I grant view rights as needed. This works perfectly.
Now I would like to produce a listing of users with view rights to each protocol (tax term). I don't completely understand how/where the data is being saved. I also use the devel node_access_user block to check rights, but this produces a table based on node.
It looks like the data field in the user table contains some data, but I do not understand the serialized format. Can someone help me get a listing by tax term of users with view rights??
Thanks to all.
Comments
Comment #1
bespokeprogrammer CreditAttribution: bespokeprogrammer commentedI too have spent a couple of hours trying to figure this one out.
I need to establish whether a user has access to a taxonomy term programmatically, by querying the database if need be, or better, by using an existing function (though it doesn't seem like the module exposes such a function).
Anyone with an idea on how to crack this?
Comment #2
conormacloud CreditAttribution: conormacloud commentedI need the same information. Can't find the connection between the User and the TAC Scheme.
Please help. Trying to import userid's from one system into drupal and I then need to set the tac lite information.
Comment #3
Dave Cohen CreditAttribution: Dave Cohen commentedDrupal's users table has a data field. It contains a serialized array of information about the user. Tac_lite's data is in there.
It makes it difficult to query in the way you guys are describing. But keeping the data there is one of the things that makes tac_lite lite. And it works with Drupal's user_load() and user_save() APIs.
Comment #4
wims CreditAttribution: wims commentedI wrote this script. Put it in a Page body and set 'input format' to PHP to generate a user list by taxonomy term.
$op is the id of the Taxonomy term to filter my overview.
Yes I know this could be better and in the correct Drupal way but I'm still a starting Drupal user ;-(
Not found a better sollution at this moment.
Comment #5
Dave Cohen CreditAttribution: Dave Cohen commentedOn a site with a lot of users, that code will run into problems.
Check out devel_node_access, part of the devel package. It's not exactly what you guys are looking for, but it may provide some ideas.
Comment #6
Cablestein CreditAttribution: Cablestein commentedI am in a similar situation as the OP. I needed to make a menu that would show ALL menu items all the time (regardless of access), but only actually link the menu items the user has access to.
I used this to grab user's taclite permissions:
Then I used this to check if the user has access to the TID (taxonomy id):
Worked fantastic for me. You will still have to deal with users who have absolutely no TAC_LITE limitations (their TAC_LITE grants array is equal to 0 or 1)... this probably means anonymous users, authenticated users and the super administrator (you). I just made cases for each type and dealt with them.
This filters out anonymous (not logged in) users:
This filters out the super administrator (you, user 1):
Best of luck!