The simple requirement
I am still falling foul of the fact that with out-of-the-box core a user without administrative rights to a taxonomy cannot view a vocabulary name.
Mine (and I'm sure many others') use case is that I have a bunch of terms spread across several vocabularies and I want to be able to use Views to present a nice overview page grouped by vocabulary but which is visible to users who have no administrative rights to terms withing those vocabularies.
This seems to be impossible to do in core but I'm sure I read some issue replies correctly that say that 'Taxonomy access fix' might sort that out.
Solution tried
I have installed 8.28 - 8.30 is quite broken and only appears to create two new 'View' perms per vocab rather than the intended 'Reorder terms in...' and 'View terms in...' but 2.8 is good.
HOWEVER, in order to allow basic users to view the vocabularies' names, I still have to apply the 'Reorder' permission to every vocab.
Negative effects of this solution
While doing so enables them to see the Vocab-grouped view as I want it also grants them access to...
/admin/structure/taxonomy
...and in turn they can attempt the 'List terms' therein and re-order them.
Fortunately any attempt by them to actually 'List terms' results in...
The website encountered an unexpected error. Please try again later.
Error: Call to a member function access() on null in taxonomy_access_fix_form_taxonomy_overview_terms_alter() (line 48 of modules/taxonomy_access_fix/taxonomy_access_fix.module).
taxonomy_access_fix_form_taxonomy_overview_terms_alter(Array, Object, 'taxonomy_overview_terms') (Line: 539)
Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'taxonomy_overview_terms') (Line: 838)
Drupal\Core\Form\FormBuilder->prepareForm('taxonomy_overview_terms', Array, Object) (Line: 279)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 91)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)So they can't actually do any damage but it all seems a bit of an uncomfortable route to allow every simply to view the names of vocabularies to me!
Anyone got any brighter ideas?
Brighter than me ;-)
Thanks all.
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | 3161541-23.patch | 67.09 KB | feyp |
| #23 | 3161541-23-tests-only.patch | 60.02 KB | feyp |
Issue fork taxonomy_access_fix-3161541
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3161541-users-need-reorder
changes, plain diff MR !3
Comments
Comment #2
anruetherThe permission names are corrected in #3155593: Incorrect Label for Reorder permission (fixed in dev). But trying out 3.x-dev the "hack" to show vocabulary names by granting the reorder permission does not help anymore (which I basically consider a good thing...). So maybe this issue needs to become a feature request: Add new permission "View name of vocabulary X". Or, the existing "View terms .. " permissions are altered so that they also grant access to the vocabulary name. That's what I would expect.
Comment #3
a.milkovskyHere is a patch
Comment #4
a.milkovskyfixed typo
Comment #6
a.milkovskyThis fix gave anonymous users access to the /admin/structure/taxonomy page.
The current problem is that the `access taxonomy overview` permission is used both for view taxonomy vocabularies list and view vocabularies. As result it is not possible to assign different permissions for these 2 operations.
It would make sense to invent a new permission 'view vocabulary X', but this would be a big change.
Theoretically we could re-use the 'view terms in X' for the vocabularies.
Comment #7
a.milkovskyComment #8
a.milkovskyUsed the 'view terms in X' permission for the vocabularies.
Comment #10
a.milkovskyfixing tests
Comment #12
a.milkovskyComment #13
a.milkovskyComment #15
a.milkovskyComment #18
feyp commentedComment #19
feyp commentedI think the best path forward would be to enable the "view label" operation in our access control handler for vocabularies and then provide per-vocabulary "view vocabulary name" permissions and a "view any vocabulary name" permission like we did for the term names, only that vocabularies have no status so no need for separate published/unpublished permissions. Another difference to the view term name permissions would be, that we would have to grant access to "view label" to everyone who has "view" access as well or else we would really break the editing process.
Comment #20
feyp commentedThis is really a feature request now, not a support request.
Comment #21
feyp commentedAttached is a patch against 4.x adding view vocabulary name permissions as discussed in #19.
Comment #23
feyp commentedI merged another issue so this patch needed a reroll.
Comment #25
feyp commentedAutomated test results are as expected for Drupal 9 and 10. I've reviewed the code once more for potential issues, but didn't find anything. I also did some manual testing on Drupal 10.0.0-alpha7 and 9.4.5 and didn't find any issues. So I'm going to RTBC this.
Comment #27
feyp commentedCommitted. Thanks all!
Comment #30
j. ayen green commentedThe new permission doesn't seem to be present in D10.
Comment #31
feyp commented@j. ayen green Thanks for letting us know. This is kind of an old issue that has already been fixed. I can see the permissions added in this issue just fine on Drupal 10.2.7 with the latest stable 4.0.1 release. If you don't see them, I'd consider this a bug. In that case, I'd ask you to please open a new issue, so that we can look into the problem. Please make sure to include your core version in the issue summary, in case there was a recent regression. Thanks.
Comment #32
j. ayen green commented@FeyP thanks! I was looking in the wrong place!