Skip to content

Saving the file settings in the admin UI resets the anonymisation review default to open #4650

Open

Description

@WilcoLouwerse

Found during a Strict review of #4580 (development → beta promotion). Present on development; introduced in #4595.

Impact

An administrator who closed the review default loses that setting, silently, the next time anyone saves the file-management settings page. Fires on every save from the UI.

The chain

updateFileSettingsOnly() rebuilds the whole fileManagement value from the request and writes ReviewPolicy::SETTINGS_KEY => $this->reviewDefault($fileData), which is null when the request has no anonymisationReview key. The admin UI (FileConfiguration.vue::saveSettings) never sends that key, and FileSettingsController::updateFileSettings does not merge with the stored value. So the first click on Save in the file settings turns "decider owns the decision, these supervisors" back into null, which ReviewPolicyResolver::instanceDefault() reads as open ownership: anyone may then change a redaction decision on a file that belongs to no schema. The test even asserts it (FileSettingsHandlerTest line 361: a save with [] returns anonymisationReview null after one was set). Compare the OpenAnonymiser password in the same save, which the author already made "absent keeps the stored one". Introduced in the "only the decider, a supervisor or an administrator changes a decision" commit (10a2d83) that arrived through the #4595 train.

lib/Service/Settings/FileSettingsHandler.php:259 — verified against b9e5d8df40.

Reproduction

Verified by reading the code at b9e5d8df40; not executed (no vendor tree, no rig in the review).
Verification: grep -n "anonymisationReview" src -r; sed -n 355,362p tests/Unit/Service/Settings/FileSettingsHandlerTest.php → no hit in src/, test line 361 asserts null after an empty save

Suggested direction

write the key only when the request carries it (array_key_exists), otherwise keep the stored declaration; allow an explicit null to clear. Either also send the stored value from the Vue form, or both.

Done when: FileSettingsHandlerTest sets a review default, saves again with a body that lacks the key, and the stored anonymisationReview is unchanged; an explicit null still clears it.

Review thread

#4580 (comment)

Fix

Proposed in #4655 (not merged yet).

Activity

  1. added
    bugSomething isn't working
    securityA user can read or write what they must not
    on Oct 15, 2026
  2. github-actions commented on Oct 15, 2026

    @github-actions
    Contributor

    Thank you for opening this issue! It has been assigned to @rubenvdlinde for review.

    What happens next:

    1. A maintainer will review this issue and determine the appropriate action
    2. If accepted, it may be converted into an OpenSpec change for structured development
    3. You will be notified of any status changes

    Triage labels:

    • triage:accept-feature — accepted as a new feature
    • triage:accept-bugfix — accepted as a bug fix
    • triage:needs-info — more information needed
    • triage:wontfix — will not be addressed
    • triage:duplicate — duplicate of another issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingsecurityA user can read or write what they must nottriageAwaiting triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions