Hide access terms

graker - May 21, 2009 - 19:44
Project:Taxonomy Access Control Lite
Version:6.x-1.3
Component:Documentation
Category:task
Priority:normal
Assigned:Unassigned
Status:reviewed & tested by the community
Description

Hello.

I used tac_lite to have an easy way to hide some of nodes from users with different roles. I've created just one vocabulary "Privacy" with "private", "authorised" and "public" terms, for nodes to be shown for me only, for registered and anonymous users respectively. Then I've set up access for roles and it works just fine.

Anyway, I don't use these terms for any other matters than TAC, so I don't like them to be shown when nodes are viewed. Thus I changed current 6.1.3 version of module a bit to add "Hide Access Terms" checkbox at module settings page. Now should I check this checkbox, all terms from access vocabulary "Privacy" will be hidden using hook_nodeapi ($op=view). The same should happen to any other vocabulary terms involved in access control but I haven't checked since I can't figure a way to use two or more vocabularies for this matter. So the patch I attach here still needs some review.

By the way, thanks for the helpful module.

And sorry for my poor English :)

AttachmentSize
tac_lite.hide_terms.graker.patch1.71 KB

#1

Dinis - May 22, 2009 - 09:21

Is this similar to a "list" switch?

So if, for example, a taxonomy browsing module was used (Taxonomy VTN etc.) then taxonomies would not appear in lists?

I use a similar arrangement in TAC for system pages and non-user content, and I don't like to have those terms and vocabularies being displayed.

Cheers,
Danielle

#2

graker - May 22, 2009 - 12:50

No, I think it's not similar. In this patch I use hook_nodeapi to hide taxonomies. This hook is invoked when every node go through some operations. In our case it's when the node is about to be displayed. Using this approach we can only hide terms of the node being prepared. So, I guess no, hook_nodeapi has nothing to do with taxonomy term lists and won't hide any terms there.

#3

Dave Cohen - May 22, 2009 - 17:43

I think hiding terms is useful for a lot of reasons (not just access control terms). I wonder if this should be its own module, or even a feature of taxonomy module. What do you think?

#4

Dinis - May 22, 2009 - 17:48

Definately useful :)

The ability to have taxonomies hidden from menus and page displays would be very useful. The older TAC module has this in the permissions setting, you have options to:

View - Update - Delete - Create - List

It's a very powerful module, but the user interface is horrendus if you have more than a a handful of vocabularies and terms.

#5

graker - May 22, 2009 - 18:45

I agree, users should have an option to hide any terms they want. Maybe it could be a table like terms_visible or something. I'm not very familiar with Drupal 7, maybe they are going to have something like that there?

Anyway, I think taxonomy module could only provide basics in terms hiding. Like options for admin to hide terms in nodes one by one or by vocabulary. Or some API like "taxonomy_get_visible_terms" and "taxonomy_set_invisible_terms" functions. Or hiding by name mask.

All the rest should be up to the third party modules, because taxonomy module can't know what devious plans we might have to create, show and hide terms, or what tricky ways we could use to show our lists of vocabularies. I mean, third party modules could provide more complex ways of hiding, depending on their main purpose. Like "hide all the terms I use for TAC at once!" (instead of manually checking them) or "hide some terms if role==...", and so on.

#6

AlexisWilke - June 15, 2009 - 20:04

Note that there are modules to hide taxonomy terms. Taxonomy hide and Term display are two that come to my mind. There are others.

Thank you.
Alexis Wilke

P.S. fixed 2nd link. 8-)

#7

graker - June 16, 2009 - 06:48

Thanks, could be helpful.

#8

matt2000 - August 5, 2009 - 01:45
Component:User interface» Documentation
Category:feature request» task
Status:needs review» reviewed & tested by the community

I don't have experience with Term Display (seems like overkill) but I'd highly suggest that a link to http://drupal.org/project/taxonomy_hide be added to the project page. It's almost essential if you're using a standard theme with tac_lite.

 
 

Drupal is a registered trademark of Dries Buytaert.