Allow configuring a dedicated OCR user - #388
Open
R0Wi wants to merge 1 commit into
Open
Conversation
Automated OCR operations were always attributed to the owner of the processed file, because the app impersonates that user to get proper filesystem permissions. This makes automated OCR indistinguishable from a manual user edit in the file version history and the activity log. Add an optional global setting "OCR user". If it is set, the whole OCR processing (user session, filesystem and therefore the resulting file version) runs with that account instead of the file owner. If it is not set, nothing changes and the file owner is impersonated as before. Notifications are still sent to the file owner, and if the configured user does not exist the app logs a warning and falls back to the owner. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PjP5Wsw6uiKSBPiXp9N7sf
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.
Summary
Changes
lib/Model/GlobalSettings.php: new nullableprocessingUserIdsetting.lib/Service/OcrService.php: reads global settings before initializing the user environment, determines the processing uid (configured user, or file owner as fallback), and separates the "processing user" from the "owner" (used for notifications).lib/Service/GlobalSettingsService.php: empty string now maps tonullfor nullable string settings, mirroring the existing0 -> nullbehavior for ints.lib/Controller/GlobalSettingsController.php: trims and normalizes blank input tonull.src/components/GlobalSettings.vue: new text input for the OCR user, saved on blur.README.md: documents the new setting and its permission requirements.Test plan
OcrServiceTest::testRunsOcrProcessWithConfiguredProcessingUserandtestFallsBackToFileOwnerIfConfiguredProcessingUserDoesNotExist.GlobalSettingsServiceTestandGlobalSettingsControllerTestfor the new setting (including null/blank handling).GlobalSettings.spec.js.Imagickextension, running as root).npm run test:unit(53 passed),npm run lint, andcomposer cs:check— all clean, no new issues introduced.Generated by Claude Code