Repository navigation
Policy: an organisation's profile pins the engine, forces polish, the learner and update checks, Clipboard mode - #119
Merged
Conversation
… learner and update checks, Clipboard mode A configuration profile's Custom Settings payload for de.dinooo13.pladder, forced values only: AllowedEngines, AllowedPolishModels, PolishDictations, LearnCorrections, UpdateChecks and ClipboardMode. ManagedPolicy in Core applies it on top of the user's settings, which stay all the file holds; it is read at launch and on the two-second permission poll. Managed controls are disabled with "Managed by your organisation." Clipboard mode keeps the app off Accessibility even with the grant: no prompt, no tap, no Cmd+V, no field read. The correction learner gets a switch in the Dictionary tab, on by default. docs/MANAGED.md is the admin guide, with an example profile. Refs #109 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.
Closes #109.
Why
Every choice about what Pladder reads and sends lived in
settings.json, which the user owns. An organisation that has to answer "what does this app read and send where" had nothing to point at. The correction learner also had no switch: the only way to stop it reading other apps' fields was to revoke the grant the paste needs.Main moved since the issue was written, and the implementation follows main:
UpdateChecks.Change
ManagedPolicy(Core) is the policy value.readturns forced property-list values into it. An unknown ID, an empty list or a wrong type (an<integer>for a Boolean too) is ignored and reported as aProblem. A list with no known ID is ignored whole, so a typo never leaves the app without an engine.apply(to:)gives the settings in effect.userSettings(from:stored:)turns a view's edit back into the user's own, so a managed value never reaches the file.ManagedPolicySource(System) reads values withCFPreferencesCopyAppValue, but only thoseCFPreferencesAppValueIsForcedreports. It synchronizes before each read, so a profile installed while the app runs is seen.AppModelkeeps the user's settings and the settings in effect. The coordinator, the polish controller, the inbox, the updater and the views see only the latter. The policy is read at launch, before the monitors are built, and on the two-second permission poll. A new policy goes through the sameSettingsChangereactions as a user's edit.ClipboardMode = true):PermissionMonitorreports the grant as absent without checking it and never asks for it.HotkeyRoutingtherefore picks Carbon, so no event tap is installed.PasteboardOutput.setClipboardModecopies instead of posting ⌘V.UpdateChecks = falseforces automatic checks off, never starts Sparkle and removes Check for Updates… from the menu, so no update request is ever made.learnCorrectionsis a new setting, on by default, shown in the Dictionary tab only where the learner can run.CorrectionInbox.isLearninggates each paste and drops proposals still on their way.docs/MANAGED.mdis the admin guide: domain, keys, Clipboard mode, an example.mobileconfig, permissions, what is not covered.make-screenshots.sh --managedcaptures any scene under a sample policy.Verified
swift test: every suite passes, including the new ones:ManagedPolicyTests: every key, an unknown engine, an empty list, wrong types, edits keeping the user's own values.ManagedPolicySourceTests: a value written to the user domain is not forced, so it is ignored.CorrectionInboxTests: switched off, the fake observer is never called and waiting proposals are dropped.PasteFlowTests: Clipboard mode copies with the grant and posts no key.CFPreferencesAppValueIsForcedmechanism, checked against the Screen Time profile on the developer's Mac: its values report forced, and Booleans arrive asCFBoolean.scripts/make-screenshots.sh --settings-scene --managedand the same without--managed, light and dark: pinned pickers and forced toggles are disabled on their values with the footer, and without a profile the window is as before plus the learner switch.plutil -lint.check-doc-pointers.sh,check-site-numbers.shand shellcheck pass.docs/MANAGED.md, installed by hand on a Mac without MDM, with this build in/Applications:managed policy: AllowedEngines, PolishDictations, LearnCorrections, UpdateChecks.settings.jsonstill named Ultra and automatic checks on.Benchmark
DictationCoordinatoris untouched, and nothing is read per dictation. The one change on the release path is a relaxed atomic load before theAXIsProcessTrusted()check inPasteboardOutput.insert. No existing benchmark covers the real paste (bench-coordinatorandbench-releaseuse a stand-in output), so here is a micro-benchmark,-O, 1,000,000 calls, on an M1 MacBook Air:AXIsProcessTrusted()AXIsProcessTrusted()That is within noise, on a release-to-paste of about 195 ms.
🤖 Generated with Claude Code