Conversation
The scope-profile server functions gated every mutation on the broad assign:configs / manage:configs capabilities. The LibreChat backend is more permissive: whole-doc lifecycle (upsert/toggle/delete) accepts assign:configs:<principalType>, and field ops (PATCH/DELETE/tombstone) accept manage:configs:<section> per section. Users holding only scoped grants (e.g. assign:configs:group + manage:configs:balance) were blocked in the panel with "Insufficient permissions: requires one of assign:configs, manage:configs" even though the backend would accept their requests. - whole-doc ops (create/toggle/delete): accept target-scoped assign:configs:<principalType> in addition to the broad caps - field ops (save/bulk save/remove/tombstone): switch to requireAllSectionCapabilities, which short-circuits on broad manage:configs and otherwise requires manage:configs:<section>
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
Users holding only scoped config capabilities (e.g. the group-manager role with assign:configs:group + manage:configs:balance) are blocked in the panel when saving a group's config with:
The LibreChat backend would accept their requests — the panel's server-function guards are stricter than the API they front.
Root cause
Every scope-profile mutation in src/server/scopes.ts gated on the broad caps only:
The backend (packages/api/src/admin/config.ts in LibreChat) is more permissive:
Scoped capabilities never imply broad ones (the implication graph only holds manage→read pairs), so the guard always threw.
Fix
Mirror the backend exactly:
Also moved the isInterfacePermissionPath early-return before the guard in saveFieldProfileValueFn / bulkSaveProfileValuesFn so interface paths never trip a section check (matches saveBaseConfigFn's existing filter-then-guard order).
Testing