Compare commits

..
Author SHA1 Message Date
weichen 551697d67d Merge remote-tracking branch 'origin/main' into fix/role-editor-single-project-toggle
governance / governance (pull_request) Successful in 15s
ci / test-and-build (pull_request) Successful in 1m2s
2026-10-23 10:29:27 +00:00
agent-exec-transport dca48a1d75 Hide system actions from the role editor
governance / governance (pull_request) Successful in 14s
ci / test-and-build (pull_request) Successful in 37s
Why: Owner reported that creating a role showed system admin permissions. The
server rejects protected system-scope actions for role writes anyway; they are
only configurable per account in the users panel, so showing them in the role
editor is misleading.

Evidence: npm run build passes and npx vitest run passes (717 tests); the two
account-panel tests that assert system capability groups keep passing because the
filter lives at the role editor call site, not in buildCapabilityGroups. The
agent-exec transport diff matches the owner-accepted change.

Impact: the role editor builds capability groups without system.* actions; the
per-account explicit grant surface is unchanged.

Refs: fix/role-editor-single-project-toggle
2026-10-23 10:27:02 +00:00
weichen d643145739 Merge pull request 'Fix the e2e first-login gate flow and admin hint locator' (#128) from fix/e2e-gate-flow into main
governance / governance (push) Successful in 15s
ci / test-and-build (push) Successful in 41s
2026-10-23 10:20:16 +00:00
+5 -1
View File
@@ -143,7 +143,11 @@ export function RolePermissionsPanel() {
const allEditableIds = useMemo(() => catalog.filter(item => !item.protected).map(item => item.actionId), [catalog])
const dirty = !!draft && visiblePatch(draft, allEditableIds).length > 0
const filtered = roles ?? []
const capabilityGroups = useMemo(() => buildCapabilityGroups(catalog.filter(item => !item.protected)), [catalog])
// 角色只承载项目范围动作:受保护的系统授权由服务端整批拒绝,
// 在角色编辑面展示只会误导(账号级显式授权仍在用户面板单独配置)。
const capabilityGroups = useMemo(
() => buildCapabilityGroups(catalog.filter(item => !item.protected && item.actionId.indexOf('system.') !== 0)),
[catalog])
const labels = useMemo(() => Object.fromEntries(catalog.map(item => [item.actionId, item.label])), [catalog])
const changes = draft ? capabilityGroupChanges(draft, capabilityGroups) : []
const breaks = draft ? linkedChainBreaks(draft.values) : []