Scope picker
v0.64.0, changelogBetaPermission scopes to grant, grouped by resource and bounded by what the viewer holds: a scope outside `allowedScopes` is listed, disabled, with the reason.
Bounded
Install
npx shadcn add @syncrobotic/scope-picker Also installs: @syncrobotic/cn, @syncrobotic/format-number, @syncrobotic/checkbox, @syncrobotic/choice-field, @syncrobotic/code, @syncrobotic/radio-group
Overview
When to use
- An API key's or a service account's scopes.
- Any grant of permission strings that must stay within what the person granting holds.
Use something else
- A role with its bundle: a Select of roles, as users-roles does.
- A few unrelated options: Choice field in a FieldSet.
More examples
States and real uses. Each example is also a Storybook story and a visual regression test.
Allow all
Zh tw
Usage rules
- Pass
allowedScopesfrom the viewer's own permissions: nobody grants what they do not hold. The rest stay listed, disabled, with the reason, so people see what exists. - Scopes are permission strings, grouped by the part before ":" (
resourceto override);resourceLabelsnames the groups. allowAllonly where the server stores "all, including ones added later" (null); never send every string as a stand-in for it.- Before you send,
boundScopesdrops anything out of bounds that came in with the value.
Changelog
- 0.64.02026-12-01Formatted with Prettier (class order sorted); the code is unchanged.
- 0.57.02026-11-27First release: scopes grouped by resource with a checkbox per group, bounded by
allowedScopes(the rest disabled with the reason), and withallowAlla choice of "all, including ones added later" apart from ticking every box;boundScopes,groupScopes.