Permission 'view terms in' is not inherited for 'view label' operation

Created on 25 October 2022, over 2 years ago
Updated 8 November 2024, 5 months ago

Problem/Motivation

The module provides two permission types - global for all terms (like view terms in {$entity->bundle()}), and individual for labels (like view term names in {$entity->bundle()}).

And with the current implementation of the logic - we've got a strange situation, when a user can see the full term, including all fields, but can't see individually the "name" field of this term - this looks very illogical!

Steps to reproduce

This can be reproduced in JSON API Request of a term - in it Drupal calls both permission queries: 'view' - for all Term, and 'view label' - for field "name".

As result, if the user has the view terms in {$entity->bundle()} permission, but don't have the view term names in {$entity->bundle()} one - the "name" field disappears from the JSON API Response.

Proposed resolution

Include global 'view' permissions when checking the 'view label' permissions.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Closed: works as designed

Version

4.0

Component

Code

Created by

🇦🇲Armenia murz Yerevan, Armenia

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

Comments & Activities

Not all content is available!

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

  • 🇩🇪Germany FeyP

    Thanks again for filing this issue and starting to work on an MR. Given that this hasn't seen any more comments/engagement from the community after my comment from approx. two years ago, I'll go ahead and close this as "Works as designed" now.

    I'm still open to revisit this for a future new major release, if there is significant support for this change from the community, but as it looks like right now from the comments/followers of this issue, it seems that most users of the module are happy with the current implementation.

Production build 0.71.5 2024