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.

Command icon 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:

Comments

SirClickALot created an issue. See original summary.

anruether’s picture

The 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.

a.milkovsky’s picture

Version: 8.x-2.8 » 8.x-3.x-dev
Status: Active » Needs review
StatusFileSize
new1019 bytes

Here is a patch

a.milkovsky’s picture

StatusFileSize
new1018 bytes

fixed typo

Status: Needs review » Needs work

The last submitted patch, 4: taxonomy_access_fix-3161541-4.patch, failed testing. View results

a.milkovsky’s picture

Assigned: Unassigned » a.milkovsky

This 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.

a.milkovsky’s picture

Assigned: a.milkovsky » Unassigned
a.milkovsky’s picture

Status: Needs work » Needs review
Issue tags: +Needs tests
StatusFileSize
new1.53 KB

Used the 'view terms in X' permission for the vocabularies.

Status: Needs review » Needs work

The last submitted patch, 8: taxonomy_access_fix-3161541-8.patch, failed testing. View results

a.milkovsky’s picture

Status: Needs work » Needs review
StatusFileSize
new4.77 KB

fixing tests

Status: Needs review » Needs work

The last submitted patch, 10: taxonomy_access_fix-3161541-9.patch, failed testing. View results

a.milkovsky’s picture

Status: Needs work » Needs review
a.milkovsky’s picture

StatusFileSize
new17.32 KB

Status: Needs review » Needs work

The last submitted patch, 13: taxonomy_access_fix-3161541-10.patch, failed testing. View results

a.milkovsky’s picture

Status: Needs work » Needs review
StatusFileSize
new17.66 KB

Status: Needs review » Needs work

The last submitted patch, 15: taxonomy_access_fix-3161541-15.patch, failed testing. View results

feyp’s picture

Version: 8.x-3.x-dev » 4.x-dev
feyp’s picture

I 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.

feyp’s picture

Component: Miscellaneous » Code
Category: Support request » Feature request

This is really a feature request now, not a support request.

feyp’s picture

Status: Needs work » Needs review
StatusFileSize
new66.04 KB
new75.14 KB

Attached is a patch against 4.x adding view vocabulary name permissions as discussed in #19.

The last submitted patch, 21: 3161541-21-tests-only.patch, failed testing. View results

feyp’s picture

StatusFileSize
new60.02 KB
new67.09 KB

I merged another issue so this patch needed a reroll.

The last submitted patch, 23: 3161541-23-tests-only.patch, failed testing. View results

feyp’s picture

Status: Needs review » Reviewed & tested by the community
Parent issue: » #3253135: Plan for Taxonomy Access Fix 4.0.0-beta1 release

Automated 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.

  • FeyP committed 8ed6de6 on 4.x
    Issue #3161541 by a.milkovsky, FeyP, SirClickALot, anruether: Add...
feyp’s picture

Title: Users need 'Reorder' permissions in order to simply view a taxonomy vocabulary name » Add permissions to view vocabulary names
Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs tests

Committed. Thanks all!

Status: Fixed » Closed (fixed)

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

j. ayen green’s picture

The new permission doesn't seem to be present in D10.

feyp’s picture

@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.

j. ayen green’s picture

@FeyP thanks! I was looking in the wrong place!