Files
envbao-admin/src/features/shared/DynamicAccessPicker.tsx
T
mattandClaude Sonnet 5.5 85a318c351 Access: grant and inspect access to dynamic engine roles
dynamicGrantRules expands a grant on a role into the credential paths
its requests need (generate) and the role CRUD paths (manage); unticked
access comes back empty so writing it revokes. Roles get an Access panel
showing who can generate credentials or manage them, and the identity
Access editor can pick dynamic mounts and roles. Checked against
capabilities-self and a real token in the integration tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 13:51:28 +00:00

24 lines
791 B
TypeScript

import { DYNAMIC_ACCESS, type DynamicAccess } from '../../model/managed'
/** Checkboxes for what a grant on a dynamic-engine role allows. */
export function DynamicAccessPicker({ value, onChange }: { value: DynamicAccess[]; onChange: (v: DynamicAccess[]) => void }) {
return (
<fieldset className="caps">
<legend>Access</legend>
{DYNAMIC_ACCESS.map((a) => (
<label key={a.id} className="check">
<input
type="checkbox"
checked={value.includes(a.id)}
onChange={(e) => onChange(e.target.checked ? [...value, a.id] : value.filter((x) => x !== a.id))}
/>
<span>
{a.label}
<span className="hint"> {a.help}</span>
</span>
</label>
))}
</fieldset>
)
}