Enforce Admin-Only Updates for Case Retention Policy via API#8765
Open
sanjacornelius wants to merge 3 commits intoepic/FOUR-29101from
Open
Enforce Admin-Only Updates for Case Retention Policy via API#8765sanjacornelius wants to merge 3 commits intoepic/FOUR-29101from
sanjacornelius wants to merge 3 commits intoepic/FOUR-29101from
Conversation
Remove retention-related properties (retention_period, retention_updated_by, retention_updated_at) from the change set if the current user is not an administrator. This ensures only administrators can modify retention settings when publishing a process.
Prevent non-administrators from modifying retention fields by unsetting retention_updated_by, retention_updated_at and retention_period from the process properties before save.
Replace inline unsets with restoreProcessRetentionPropertiesFromOriginal. For non-administrator updates, reapply retention-related keys (retention_updated_by, retention_updated_at, retention_period) from the original model snapshot—decoding string-encoded properties if needed—and restore or remove keys to match the original state. This prevents non-admins from adding or modifying retention metadata and handles different properties formats robustly.
|
Contributor
|
QA server K8S was successfully deployed https://ci-9079376f1b.engk8s.processmaker.net |
mcraeteisha
approved these changes
Mar 31, 2026
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.




Issue & Reproduction Steps
This PR resolves an issue where non-admin users were able to modify Case Retention Policy configurations via the API. With this change, only admin users can update retention-related fields, ensuring proper authorization at the backend level.
Solution
How to Test
/api/1.0/processes/{id}with retention policy updatesRelated Tickets & Packages
ci:deploy
Code Review Checklist