Add permissions group-update for existing groups' object and field controls - #30
Merged
Merged
Conversation
…ntrols Raises or lowers object/field/section controls on a group that already exists, reusing group-create --settings-file's op shapes. Dry-run shows current -> target per op, read from the live group. object-update reports an unhonoured level in its response body rather than 4xx-ing, and three outcomes look identical on the wire, so they are now separated. A level outside the control's own allowed_access is rejected at plan time before any write. A legal level that a cross-field rule then normalizes is reported as adjusted, not failed — the server applied a value these commands deliberately delegate to it, so the exit code stays 0. A control with no entry in the group at all is inserted at none and cannot be raised; that one still fails loudly. The plan-time check also covers group-create --settings-file, which was reachable by the same path.
annaliu-kizen
approved these changes
Sep 4, 2026
jbedient-kizen
changed the base branch from
feat/team-member-role-lookup
to
main
September 4, 2026 16:39
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.
Problem
Permission groups could be created with shaping settings but never adjusted afterwards — there was no way to raise or lower a control on a group that already exists.
Solution
kizen permissions group-update <group> --settings-file <f>takes the same op shapesgroup-create --settings-filealready accepts, so the settings format has a second consumer rather than a second dialect. Dry-run showscurrent -> targetper op, read from the live group.The substance of this PR is what happens when the server does not honour the level you asked for.
object-updatereports that in its response body rather than 4xx-ing, and three different situations look identical on the wire. They are now separated:associated_records: none, which has nononein itsallowed_access. Rejected at plan time, before any write.associated_recordsclamped up to satisfyassociated_records >= all_records. Reported asadjustedwith a plain-language message. Not a failure: the server applied a value this design deliberately delegates to it, so the exit code stays 0.noneand cannot be raised. Stillfailed, loudly.Testing
bin/check.sh— all five steps pass:1455 passed, 4 skipped(+13).All three outcomes were verified live against a disposable tenant, not just unit-tested:
Design notes / tradeoffs
Case 2 cannot be caught at plan time without reimplementing the server's rule engine — the outcome depends on the group's combined final state, including ops earlier in the same plan. That is deliberate: the reason this uses
object-updateinstead of hand-building a full-group PUT is precisely so the server owns those rules.adjustedis a new value onOperationResult.status, visible inapply --json. Nothing consumes it today, but it is a schema addition rather than an internal detail, so it is worth a deliberate look.The plan-time range check also covers
group-create --settings-file, which was reachable by the same false-failure path. That widens this branch slightly beyondgroup-update; leaving a known bad path in place to keep the diff narrow seemed worse.Fifth of six stacked branches.