Switching users retains UI for previous userโ€™s edit access

Created on 30 January 2025, 3 months ago

Problem/Motivation

When switching between users, the previous userโ€™s edit access is still retained in the UI in the Primary tabs block. The "Edit" button is still visible even for users who do not have edit access. However, when they click on the edit link, they correctly receive an access denied message.

Steps to reproduce

  1. Install Drupal.
  2. Install, enable, and configure the Content Access by Path module.
  3. Grant correct permissions for user to edit content.
  4. Log in as User A (who has edit access to a node).
  5. Log out and log in as User B (who does not have edit access).
  6. Navigate to the same node.
  7. Expected: The "Edit" button should not be visible to User B.
  8. Actual: The "Edit" button is still visible, but clicking it results in an access denied error.

Proposed resolution

Add cache contexts for user to ensure the UI properly reflects the current user's permissions.

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States kevinfunk

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024