Skip to content

FOUR-34597: Fix profile updates for non-admin users - #9207

Open
eiresendez wants to merge 3 commits into
developfrom
task/FOUR-34597
Open

eiresendez wants to merge 3 commits into
developfrom
task/FOUR-34597

Conversation

@eiresendez

@eiresendez eiresendez commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Issue & Reproduction Steps

  1. Sign in as a non-admin user with the Edit Personal Profile permission.
  2. Open Edit Profile, change the first name, and click Save.

After the Vite migration, the form submitted the full user record, including read-only fields such as created_at. The API rejected the request with HTTP 403, so the change was lost on reload.

Solution

Use the existing profilePayload() method to send only the fields allowed for a profile update. The API's field authorization stays in place.

How to Test

Repeat the steps above and reload the page. Verified in Chromium that the save returned HTTP 204 and the new first name persisted after reload.

Related Tickets & Packages

@cursor

This comment was marked as resolved.

@eiresendez eiresendez self-assigned this Nov 26, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5d3257d. Configure here.

Comment thread resources/views/profile/edit.blade.php Resolved
@eiresendez

Copy link
Copy Markdown
Contributor Author

PR Summary

Medium Risk Changes user update authorization and metadata merge behavior on a core API path, though scope is limited to profile saves and covered by new tests.

Overview Fixes Edit Profile saves that failed with HTTP 403 after the Vite migration because the UI posted the full user record (including read-only fields like created_at). The profile form now sends only allowed fields via profilePayload() and sets X-ProcessMaker-Profile-Update: 1 on the PUT.

On the API, UserController::update is split into helpers, and profile/self-service updates use mergeProfileMeta so server-managed meta is preserved when users (including administrators) save their own profile. validateContactUpdate / validateEmailChange keep the same email and cell rules as before.

Adds a Dusk test for metadata preservation across permission profiles and an API test for administrators saving their own profile.

Reviewed by Cursor Bugbot for commit c6ac4b1. Bugbot is set up for automated code reviews on this repo. Configure here.

Addressed in b7c700e71. Saving your own profile now updates the recommendations preference while preserving existing server-managed metadata, including for administrators and users with Edit Users permission. Administrative edits to other users retain their existing behavior. Verified across all three permission profiles. UsersTest and ProfileTest passed.

@nolanpro

Copy link
Copy Markdown
Contributor

QA server K8S was successfully deployed https://tenant-1.ci-c76f150876.engk8s.processmaker.net

@decisions-sonarqube

Copy link
Copy Markdown

@CarliPinell

Copy link
Copy Markdown
Contributor

The code looks good. No observations.

@CarliPinell CarliPinell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No observations were found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants