Switching users retains UI for previous user’s edit access
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3503461. --> Reported by: [kevinfunk](https://www.drupal.org/user/414328) Related to !9 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>When switching between users, the previous user&rsquo;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.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <ol> <li>Install Drupal.</li> <li>Install, enable, and configure the Content Access by Path module.</li> <li>Grant correct permissions for user to edit content.</li> <li>Log in as User A (who has edit access to a node).</li> <li>Log out and log in as User B (who does not have edit access).</li> <li>Navigate to the same node.</li> <li>Expected: The "Edit" button should not be visible to User B.</li> <li>Actual: The "Edit" button is still visible, but clicking it results in an access denied error.</li> </ol> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Add cache contexts for user to ensure the UI properly reflects the current user's permissions. </p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> > Related issue: [Issue #3319445](https://www.drupal.org/node/3319445)
issue