different terms depending on $user data
I need groups of users sharing a taxonomy, but not terms; the group is defined depending on their user profile; so I have been able to write a module using hook_node_grants and hook_node_write_perms to separate their content; but now I need them able to categorize it. So a user inside "one group" should be able to add terms (if their permissions allow him to do so) and that term should only be visible to his group. Any hint of how to achieve this is welcome. -- *La vida és com una taronja, què esperes a exprimir-la? *Si creus que l'educació és cara, prova la ignorància. *La vida és com una moneda, la pots gastar en el que vulguis però només una vegada. *Abans d'imprimir aquest missatge, pensa en el medi ambient.
Consider tac_lite.module as an example. It uses hook_db_rewrite_sql() to hide some terms from some users. Note that this hides the terms completely (i.e. when viewing a node you will not see the tags) rather than removing them only from forms (which should be done with hook_form_alter). -Dave On Monday 22 June 2009 05:55:34 Lluís wrote:
I need groups of users sharing a taxonomy, but not terms; the group is defined depending on their user profile; so I have been able to write a module using hook_node_grants and hook_node_write_perms to separate their content; but now I need them able to categorize it.
So a user inside "one group" should be able to add terms (if their permissions allow him to do so) and that term should only be visible to his group.
Any hint of how to achieve this is welcome.
On 22-Jun-09, at 8:55 AM, Lluís wrote:
I need groups of users sharing a taxonomy, but not terms; the group is defined depending on their user profile; so I have been able to write a module using hook_node_grants and hook_node_write_perms to separate their content; but now I need them able to categorize it.
The first half of this can be done with the term_permissions module I wrote to use with Simplenews. It can limit terms to those in a role (or by user), but doesn't handle newly created terms like what might occur with free tagging. Feel free to submit a patch :) If you are pre-defining all of your terms, this might work for you as- is. http://drupal.org/project/term_permissions --Andrew
participants (3)
-
Andrew Berry -
Dave Cohen -
Lluís