different terms depending on $user data

View: New views
3 Messages — Rating Filter:   Alert me  

different terms depending on $user data

by Lluís Forns Puigmartí-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

Re: different terms depending on $user data

by David Cohen-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.
>

Re: different terms depending on $user data

by Andrew Berry-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

smime.p7s (3K) Download Attachment