fix: class_defaults permissions use wrong field names (allow/deny vs a/d) - #5
Merged
Merged
Conversation
…ss_defaults
Server.setClassDefaultPermissions/setClassDefaultMaxMessageLength built
each ClassDefault.permissions entry with {allow, deny} keys, but the
backend's ClassDefault.permissions field is typed as OverrideField
({a, d}) - the same shape every role's permissions already use. The
mismatch caused Rocket to reject the PATCH /servers/{id} body outright
with a 422 before it ever reached application logic, breaking the
"Role Classes" settings save button entirely.
1 task
bluecords
added a commit
to bluecords/nac-web
that referenced
this pull request
Jul 5, 2026
#93) The Role Classes settings page was broken end-to-end - saving a class's permissions or max message length threw a 422, because the SDK built the request body with {allow, deny} keys where the backend expects {a, d} (bluecords/javascript-client-sdk#5).
2 tasks
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
Server.setClassDefaultPermissions/setClassDefaultMaxMessageLengthbuild eachClassDefault.permissionsentry with{allow, deny}keys, but the backend'sClassDefault.permissionsfield is typed asOverrideField({a, d}) - the same shape every role'spermissionsfield already uses everywhere else in this SDK.{allow, deny}is the shape for the differentOverridetype used only by thePUT /servers/{id}/permissions/{role_id}endpoint.ClassDefault.permissions->OverrideField(a/drequired),DataSetServerRolePermission.permissions->Override(allow/denyrequired). These are two distinct schemas with different field-naming conventions, and this code was using the wrong one.Test plan
pnpm typecheckclean