I am using taxonomy access control to control what content is visible to the anonymous users. But it seems that taxonomy access control didn't support multi-layer taxonomy and multi taxonomy. For example, i set a multi layer taxonomy vocabulary with one for the root, and two, three are all the child of one. The blog is only visible to the anonymous users when one is the only taxonomy. If two is the only taxonomy, it would be invisible and even if one and two are the taxonomies, the blog is still invisible to the anonymous users. Is it possible to just set a term so that all the articles contain that term or its child term would all have the same permission?

Sorry for my bad english.

Comments

anttih’s picture

There is currently a possibility to have a *default* permission for a vocabulary. Hierarchical vocabularies would benefit from similar *default* permissions for terms too. A new term would then inherit the permissions of its parent term. If multiple parents are allowed, the admin would probably need to be able to decide whether the inherited permissions are anded or orred, probably on per vocabulary basis. If I understood the original feature request correctly, this would solve that problem too.

xjm’s picture

If I've understood correctly, I am looking for this functionality as well--I want users who have permissions granted for a certain term to have grants for all the child terms as well, without having to add every single term to the form. My vocabulary defaults need to be set to "Ignore" so that the children of other terms don't get access granted unintentionally.

hellznrg’s picture

i'm looking for this feature too... currently i have my site organized into "levels"..

Level 0 (root)
-Level 1
--Level 2
---Level 999

if i tag a node as "level 1", i only want people of level 1 or higher level to be able to view it.. but if i assign the "level 1" role allow permission to "level 1" nodes, they can't see "level 2" and "level 999" nodes without an explicit permission

mr.andrey’s picture

subscribing... would like to see a recursive functionality as well.

xjm’s picture

Title: Nested control of taxonomy access control? » Should unconfigured terms inherit access control settings of parent terms?
Version: 5.x-2.x-dev » 6.x-1.x-dev
xjm’s picture

Apparently the Taxonomy Access User module provides this sort of inheritance, so would be worth looking that module over to see how they implement it.

xjm’s picture

Got a +1 for this today from IRC, specifically for use with forum.module where forums are being added by someone who does not have access to administer TAC.

xjm’s picture

Note that we would probably want to add this as a configuration option, as this would introduce a change in behavior that might not be expected for some configurations

BoogieBug’s picture

StatusFileSize
new8.44 KB

Here's a quick patch to the taxonomy_access.module to enable the permission inherit to the un-configured term(s). This will enable the feature by default and cannot disable when patched. I'd like to leave the Configuration UI task to the maintainer.

I've tried to create a new module to extend the ability but unfortunately it is impossible to override the outcome from hook_db_rewrite_sql() to allow the 'create' and 'list' to be inheritable.

BoogieBug’s picture

StatusFileSize
new8.95 KB

Sorry, I put the wrong patch file. Please ignore my previous one and use this one.

BoogieBug’s picture

Component: Miscellaneous » Code
StatusFileSize
new6.55 KB

I've just realised that the $node->taxonomy is in different format in different situation: when new node is added and when the permission is rebuilt. This is the bugs-fix version for the patches in #11 and #12 against the current HEAD version (06 Nov 2010).

Also this patch allow the administrator to disable the inheritance by setting the variable TAXONOMY_ACCESS_CFG_INHERIT to 0 or FALSE (either using variable_set() or by directly insert into the database).

I wonder if the maintainer still monitor this issue?

xjm’s picture

Status: Needs work » Needs review

I pay the most attention to issue statuses. If there's a patch that's needs review, set the issue to Needs Review. :)

I'd like to see some users test this patch before I review it. We'd also probably need to include a hook_update_N() since this changes the behavior of the module for those child terns.

Edit: Also, just skimming, the patch needs a little code cleanup. E.g., leave out the comments about what section you've added; that's what the diff is for. :)

xjm’s picture

Status: Active » Needs work

Also, the way $list is being used in the query here is not very clean; we need to be a little more careful for security. See:

So I'd say fix that, clean up the comments a bit to standards, and then we'll give it another look.

francewhoa’s picture

Status: Needs review » Needs work

Any volunteers to update the patch in comment #13 or make a new one? We would be happy to contribute patch testing.

xjm’s picture

Issue tags: +TAC UX

Tagging.

renenee’s picture

+1 Also interested in this functionality.

davidneedham’s picture

Issue summary: View changes
Status: Needs work » Closed (duplicate)
Related issues: +#1673558: Set access set at partent term level?

Probably doesn't matter 3 years later, but I believe this is a duplicate of #689668: Recursive functionality: automatically set permission to the child terms..

FYI: That fixed this issue for D6, but it strangely no longer exists in D7: #1673558: Set access set at partent term level? .