Repository navigation
Conversation
…ion-cms#2553) The save redirected to the user list, which needs edit_user, so a role without it saw "You don't have enough privileges" and lost the tab even though the password had changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The form changes the viewer's own password only, yet a second manager opening it while another had it open was refused with the privilege error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A role with delete_user but not edit_user deleted the user and then got the privilege error from the list. It now lands on the dashboard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2553.
Problem
A manager without
edit_userwho changes their own password gets "You don't have enough privileges for this action!" and loses the tab, although the password has changed.ChangePassword::process()saves the password, then always redirects toa=99, the user list, and the list requiresedit_user. Traced in Chrome on an Editor:302 -> a=99, the alert, the tab closes.The default Publisher has
edit_user, so with the seeded roles only the Editor reproduces it; a Publisher role without that permission behaves the same.Changes
One commit each:
a=2), where the form's Cancel button already goes and which no role is refused. This applies to every role, so administrators land there too instead of on the user list.Password::checkLocked()refused anyone who opened the page while another manager had it open, with the same privilege message. The form only changes the viewer's own password, so there is nothing to conflict with, and the lock is gone.DeleteUserhad the same redirect. A role withdelete_userbut noedit_userdeleted the user and then got the error. It now goes to the list only withedit_user, otherwise to the dashboard. Such a role has no link to this action, so this takes a direct URL with a valid token.There is still no success message after saving a password, as before. It would need a new lexicon key and translations, so it is left out.
Verification
tests/Unit tests/Featureon PHP 8.4 (Linux): 2253 passed, 9 skipped. PHPStan: no errors.ChangePasswordRedirectTest,PasswordPageLockTest,DeleteUserRedirectTest, each failing before its fix. The two redirect tests read the source, becauseprocess()ends inexit().edit_user(the list still opens with it).🤖 Generated with Claude Code