Vocabulary name not shown in View for Anonymous Users

Created on 18 February 2020, almost 5 years ago
Updated 12 April 2024, 9 months ago

Problem/Motivation

If I enable the "Access the taxonomy vocabulary overview page" permission for Anonymous users, the Vocabulary names appear; they also have access to the /admin/structure/taxonomy path, which I don't wish to allow. I don't see any other permission for allowing access to the Vocabulary name.

This also occurs if I am not using grouping - if I want to list a term in a row with its Vocabulary name, the name does not appear without the user having the above permission.

Steps to reproduce

I have a Taxonomy term view which groups several terms by their Vocabulary name. For example:

- Vocab 1
-- Term 1
-- Term 2
- Vocab 2
-- Term 3
-- Term 4

However, if I am not logged in, the Vocabulary names are not shown. The output is instead like this:

-- Term 1
-- Term 2
-- Term 3
-- Term 4

Proposed resolution

There are two solutions proposed for this issue.
#29 where we can add access for `view label` operation. (Added in issue's PR)

Per @xjm and @larowlan the solution forward is a new permission "view vocabulary labels" which builds on proposal 1

Remaining tasks

  • Needs discussion about solution approach. #45 @xjm agreed on the solution of a new permission by @larowlan
  • #45 @xjm gave feedback

User interface changes

N/A

API changes

New permission "view vocabulary labels" added

Data model changes

N/A

Release notes snippet

🐛 Bug report
Status

Fixed

Version

10.3

Component
Taxonomy 

Last updated 2 days ago

  • Maintained by
  • 🇺🇸United States @xjm
  • 🇬🇧United Kingdom @catch
Created by

🇺🇸United States wsantell

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    Patch Failed to Apply
  • last update about 1 year ago
    30,388 pass, 7 fail
  • last update about 1 year ago
    29,644 pass, 7 fail
  • 🇺🇸United States alison

    FWIW, the patch in #34 does apply fine to 10.1!

    I attempted to adjust the tests so it runs against 10.1.x, too; I hope I did it right, if not, ...oops and I hope it doesn't cause a hassle, I gave it a shot 🤞

  • 53:32
    18:32
    Running
  • 53:17
    12:31
    Running
  • Updated the expected permissions in the test failing in #34. I'll leave it to someone else to review whether that change should be made or not.

  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    29,652 pass, 6 fail
  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    30,414 pass, 6 fail
  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    29,676 pass
  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    30,438 pass
  • Status changed to Needs review about 1 year ago
  • Status changed to Needs work about 1 year ago
  • 🇺🇸United States smustgrave

    Reviewing this part of the needs review queue. And the issue summary seemed incomplete. Got it started if relevant sections to this issue could be filled in please.

  • 🇬🇧United Kingdom SirClickALot Somerset

    I am really struggling to understand quite why this is still a thing.

    I first discovered this on my sites about 4 years ago and I have looked back today to find that I did indeed contribute here.

    Right now, my non-admin users (e.g. Anonymous and Authenticated) still cannot view Vocabulary names and it's madness!

    I wholeheartedly agree that if they can View published content then they really ought, with any question, by able to view the names of the vocabs that are used to categorise that content. Seem like a Page 1 thing to me or have I really missed something here?

    The only way for me to enable my users to see vocabulary names is by giving them Administer vocabularies and terms permission and I sure as hell am not going to do that.

    Adding in the Taxonomy Access Fix module and ticking every occurrence of...

    >: View vocabulary name
    Has no effect at all, none of my users cannot view the NAME of any vocabulary.

    Even with...
    View any vocabulary name TICKED for both Anonymous and Authenticated they still cannot view any vocabulary names.

    By completely rebuilding some of my Content views and Search API Index views where I expose vocabulary names as fields, I was eventually able to get my user the what I wanted, i.e. a simple page of Term sorted alphabetically and grouped under Vocabulary name but one shouldn't need an MSc in Drupal site building to get such a simple thing done ;-)

    After all the various threads here are at a point where we can just go with 'View Published content' or or we must, simply 'View Taxonomy vocabulary names'.?

  • 🇺🇸United States danflanagan8 St. Louis, US

    Hi @SirClickalot! Per the comment in #41, this issue is in need of an issue summary update. I'd agree with that assessment given that the proposed resolution is stated as TBD. This issue won't likely get over the finish line until someone tidies up the summary, which will allow core committers to easily assess the fix after this gets to RTBC.

  • Status changed to Needs review 10 months ago
  • 🇮🇳India mohit_aghera Rajkot

    Based on @Berdir's feedback in #29,
    I've added a PR that adds permissions for `view label` operation.

    I think we need some inputs from sub system maintainer about which is the correct approach.
    I feel that `view label` access is more safe and restricted.

    Updated the issue summary and mentioned that we need consensus about the solution.
    Hiding other patches since #37 seems another valid implementation and passing test cases as well.

  • Pipeline finished with Success
    10 months ago
    Total: 533s
    #119974
  • Status changed to Needs work 9 months ago
  • 🇺🇸United States xjm

    Thanks everyone for your thoughtful comments and work on this issue! It's good to see all the different comments showing that this definitely needs a fix.

    I agree with @larowlan that this should actually have its own permission. "Access content" is almost as overmuch in its way as "administer taxonomy terms". A dedicated permission would improve the functionality and also be a sort of security hardening. :D

    NW to implement that. Thanks!

  • Pipeline finished with Canceled
    9 months ago
    Total: 155s
    #126122
  • Pipeline finished with Failed
    9 months ago
    Total: 465s
    #126126
  • Pipeline finished with Success
    9 months ago
    Total: 668s
    #126192
  • Status changed to Needs review 9 months ago
  • 🇮🇳India mohit_aghera Rajkot

    Tests are green, back to needs review

  • Status changed to Needs work 9 months ago
  • 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

    Hiding patches

    Left a comment on the MR, I think we can simplify this to a single permission

  • Pipeline finished with Success
    9 months ago
    Total: 564s
    #126746
  • Status changed to Needs review 9 months ago
  • 🇮🇳India mohit_aghera Rajkot

    Fixed the feedback.

  • Status changed to Needs work 9 months ago
  • 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

    Very close, couple of minor things

  • Pipeline finished with Canceled
    9 months ago
    Total: 317s
    #130673
  • Pipeline finished with Success
    9 months ago
    Total: 499s
    #130677
  • Status changed to Needs review 9 months ago
  • 🇮🇳India mohit_aghera Rajkot

    Fixed the PR feedback.

  • Status changed to RTBC 9 months ago
  • 🇺🇸United States smustgrave

    Appears feedback from @larowlan has been addressed

    Cleaned up the issue summary some to include the new proposed solution.

    Also drafted a simple change record https://www.drupal.org/node/3436818 to announce the new permission.

  • Status changed to Fixed 9 months ago
  • 🇬🇧United Kingdom alexpott 🇪🇺🌍

    Assigning issue credit.

    I do wonder if a new permission is the best thing here. But going with the decision by @xjm and @larowlan. I also wonder how you are going to find this permission if you are trying to fix this problem.

    Committed and pushed 8d5b54efa8 to 11.x and 495174e527 to 10.3.x. Thanks!

    • alexpott committed 495174e5 on 10.3.x
      Issue #3114365 by mohit_aghera, david.muffley, danflanagan8, Greg__,...
    • alexpott committed 8d5b54ef on 11.x
      Issue #3114365 by mohit_aghera, david.muffley, danflanagan8, Greg__,...
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024