Toolbar still shows "Edit profile" link

Created on 11 March 2018, over 6 years ago
Updated 4 August 2023, 11 months ago

When I disable the "Change own account" permission, the link to "Edit profile" is still available in the toolbar, and it leads the user to an "Access denied" error.

In 8.0.x through 8.4.x, this link can be removed with hook_toolbar_alter().

In 8.5.x and beyond, it is necessary to replace the user.toolbar_link_builder service.

The attached patch implements both approaches.

It should theoretically be possible to decorate the service instead of replacing it (see #2899392-42 β†’ ). I had this code working, in fact, but I couldn't figure out how to decorate a non-existent service when I was running 8.4.x: I get Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "user.toolbar_link_builder". in /app/vendor/symfony/dependency-injection/ContainerBuilder.php:803.

✨ Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jproctor

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.

Production build 0.69.0 2024