Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In attach small patch, which integrates Hierarchical Select and Term permissions.
Comment | File | Size | Author |
---|---|---|---|
#6 | hs_taxonomy.module.patch | 1023 bytes | iv |
hs_taxonomy.patch | 976 bytes | Romka | |
Comments
Comment #1
Wim LeersI'd like to see benchmarks first. I think this is going to affect performance a lot.
Comment #2
Wim LeersComment #3
Wim LeersClosing due to lack of response. Feel free to reopen.
Comment #4
iv CreditAttribution: iv commentedNo 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.
Comment #5
Wim LeersFeel free to reroll the patch! :)
Comment #6
iv CreditAttribution: iv commentedFair 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.
Comment #7
Wim LeersThanks!
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