In attach small patch, which integrates Hierarchical Select and Term permissions.

CommentFileSizeAuthor
#6 hs_taxonomy.module.patch1023 bytesiv
hs_taxonomy.patch976 bytesRomka
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wim Leers’s picture

Priority: Normal » Minor
Status: Patch (to be ported) » Needs work

I'd like to see benchmarks first. I think this is going to affect performance a lot.

Wim Leers’s picture

Title: Integration Hierarchical Select and Term permissions » Term permissions support for Hierarchical Select Taxonomy
Wim Leers’s picture

Status: Needs work » Closed (fixed)

Closing due to lack of response. Feel free to reopen.

iv’s picture

Status: Closed (fixed) » Needs work

No performance impact without Term Permissions active, and needed for Term Permissions to work, if enabled.

However, the patch as provided only appears to enforce permissions on the top-level terms of each Vocabulary - if a top-level term is allowed, then all children of that term are also.

Wim Leers’s picture

Feel free to reroll the patch! :)

iv’s picture

Version: 6.x-3.x-dev » 6.x-3.0
Status: Needs work » Needs review
FileSize
1023 bytes

Fair enough :)

... Done!

No impact without Term Permissions installed (one call to function_exists('term_permissions_allowed') for each entry into hs_taxonomy_hierarchical_select_root_level() and hs_taxonomy_hierarchical_select_children().

With Term Permissions installed, equivalent to its performance with the vanilla handler (one call to term_permissions_allowed() per term).

Term Permissions special-cases a few things that this patch does not - a vocabulary that ends up empty (due to not having permissions to ANY terms in it) is removed from the form completely, and if a "required" vocabulary ends up in that state, an error is generated, and the form is terminated.

I may add those tomorrow, time permitting.

Wim Leers’s picture

Title: Term permissions support for Hierarchical Select Taxonomy » Term Permissions support for Hierarchical Select Taxonomy
Status: Needs review » Fixed

Thanks!
Patch committed, along with an additional check in the "valid item hook". Feel free to contribute patches that improve this further.

http://drupal.org/user/99777

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.