Currently, the create op is controlled solely in hook_db_rewrite_sql()
. This has advantages and disadvantages. Another method would be to use hook_nodeapi()
and hook_form_alter()
.
This would resolve:
#112307: Cannot create node in taxonomy term without create permission for parent term
and avoid problems like:
#881210: No list or create permissions on any terms may result in incorrect use of default on save
#660668: TAC + revisioning: Empty taxonomy term select list on node/add for regular users
There are a couple of disadvantages. One is that FAPI's #access
option can only apply to whole form elements, so if the user has access to create some terms in a vocabulary but not others, we still have to override the whole form element. Another is that any form overrides we provide will by default support only the core taxonomy forms, not other modules that alter those forms (like Content Taxonomy).
For these reason, we might want to make this behavior configurable, and possibly release it only in a new branch since it involves major changes to the way create functions.
Original patch is at:
http://drupal.org/files/issues/tac_881210-9.patch
Comment | File | Size | Author |
---|---|---|---|
#1 | tac_903522.patch | 16.88 KB | xjm |
Comments
Comment #1
xjmAlso, a
hook_update_N()
would need to be provided because of #112307: Cannot create node in taxonomy term without create permission for parent term, to prevent an unexpected change in behavior for anyonewho for whatever reason has create checked for a parent term but not its children.
Same patch as above, just renamed for consistency. It applies with an offset currently.
Comment #2
xjmSee also #202039: Content Taxonomy Autocomplete terms are created twice if role does not have "create" privs for the vocab.
Controlling create in
hook_nodeapi
might help resolve that issue and other issues with freetag vocabularies:#198773: Free tag vocabularies do not respect TAC and may cause duplicate term insertion
#676176: Caching in tac_db_rewrite_sql results in duplicate tags for freetaging vocabularies
#114341: Exclude freetagging enabled vocabularies from category permissions page
Comment #3
xjmSee also #308682: Cooperation with Clone/Revisioning/... module. We need to address that case somehow as well.
Comment #4
xjmSee also:
http://drupal.org/node/112307#comment-3410204
http://drupal.org/node/881210#comment-3411118
Comment #5
xjmRelated bug: #1078808: Non-multiple, required vocabulary: Update without Create forces node to be tagged with an extra term