Problem/Motivation

Originally reported by @StuartL for 8.x-1.0: with "Access role users profiles" granted, the user can open those profiles, but usernames (username.html.twig) don't link to them.

Since Drupal 11.4 (core #3506444), core decides whether a username links to the profile with the view linked label access operation. ViewProfilesPermsAccessHandler only grants view, so on 11.4 and later usernames never link to profiles that are visible only through this module's permissions: author information, comments, and Views username fields.

Steps to reproduce

  1. On Drupal 11.4 or later, create roles Developer and Manager, and grant Developer "Access Manager users profiles".
  2. As a Developer, view content authored by a Manager.
  3. The author name isn't a link, although /user/ID for that Manager is accessible.

Proposed resolution

Grant view linked label under the same conditions as view.

Remaining tasks

  • Review.
  • Check whether this also covers #3170848: since 11.4 core checks access before linking, so names of users the viewer can't see should no longer link.
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

StuartL created an issue. See original summary.

manuel garcia’s picture

Did you assign the access site_profile profiles and access working_paper_publisher profiles permissions to annonymous and authenticated roles?

manuel garcia’s picture

Title: Username.html.twig Not Receiving Link to Profile » Usernames don't link to profiles that are visible through this module's permissions
Version: 8.x-1.0 » 2.1.x-dev
Issue summary: View changes
Status: Active » Needs review

Updated the summary: since 11.4 core links usernames based on a new view linked label access operation, which this module didn't grant. MR !9 grants it under the same conditions as view, with a test, on top of the 11.x/12.x compatibility work in #3540750.

AI-Generated: Partially. Claude Code found the core change, drafted the fix, the test and this text; I reviewed them and ran the tests.