Hello
There's a module, Taxonomy Access Fix, which besides other things, adds a permission to add terms to a vocabulary (in contrast to Edit and Delete terms), and in short, having it installed, allows admins to give add + edit + delete terms permissions per vocabulary, instead of giving administer taxonomy permission.
When we have taxonomy access fix enabled and remove that administer taxonomy permission from users, when they are adding new references in the edit forms, they are presented with the Edit button, but not the Add button.
Please add support for it by integrating with Taxonomy Access Fix when it's present.
note: it's a per vocabulary Add term permission, just like Edit/Delete term.
Comments
Comment #1
andypostSuppose related issue #1429288: References dialog for Term reference
Comment #2
lpalgarvio commentedI'm using References Dialog with Entity Reference
http://drupal.org/project/entityreference
i've also created an issue at Drupal Core
#1839604: Add taxonomy term permission
Comment #3
k_zoltan commentedThis patch should do the work when working with taxonomy_access_fix and the reference_dialog module.
Its a quick solution and it could have been done better, bot that would require also some changes in the
taxonomy_access_fix_accessfunction too.Comment #4
rudiedirkx commentedYour patch uses
entity_access(), but this module doesn't have entity.module as a dependency... What am I missing?Comment #5
gilsbert commentedHi.
The last dev version is not compatible with the suggested patch #3.
For the last dev version we can use the following patch:
[edited] file: references_dialog/references_dialog.dialog_widgets.inc [/edited]
@@ -280,6 +280,15 @@
$access = node_access('create', $bundle);
break;
+ case 'taxonomy_term':
+ if (function_exists('taxonomy_access_fix_access')) {
+ $vocabulary = taxonomy_vocabulary_machine_name_load($bundle);
+ $access = taxonomy_access_fix_access('add terms', $vocabulary);
+ } else {
+ $access = entity_access('create', $entity_type);
+ }
+ break;
+
default:
$access = entity_access('create', $entity_type);
break;
I'm also changing the status for RTBC trying to get maintainers attention.
P.S.: I stil dont know how to properly write a patch file and I apologize for this.
Regards,
Gilsberty
Comment #6
rudiedirkx commentedIf you want to know how to patch: https://drupal.org/node/707484 you'll need git.
I'm not sure why I'm following this issue. Bye =)
Comment #7
gilsbert commentedHi.
Thank you very much for guiding to the correct place to learn about patches.
I'm sending a suggested patch to integrate "references_dialog" with "taxonomy_access_fix".
I tested on my environment with 100% success.
Regards,
Gilsberty
[edited] The patch works for the last dev version. [/edited]
Comment #8
sanderleyandrade commentedI applied patch #7 and it is working perfectly.
Comment #9
WorldFallz commentedI like this functionality and the patch, but none of the involved modules have entity as a dependency so entity_access to should be replaced with non-entity dependent code.
Comment #10
WorldFallz commentedactually, entity_access is all over references_dialog so it seems rd has an undeclared dependency on it.
Comment #11
WorldFallz commentedActually, this method and these patches no longer work at all with the current dev. Here's a patch that works and no longer requires entity_access. Will be committed to the current dev shortly.
Comment #12
WorldFallz commentedAnd I'm surprised there isn't a bug report for it, but the module currently also ties edit access for term references to the "administer taxonomy" perm rather than the edit perm. Here's an updated patch the fixes both.
Comment #14
WorldFallz commentedfixed.
Comment #16
WorldFallz commentedNow i get it. #7 was for er fields as opposed to term ref fields. Committed it substituting module_exists() for function_exists(). And entity_access dependency is not an issue since er already has entity as a dependency.
This should now be working properly for both er and tr field types.