diff --git a/web/auth/users.html b/web/auth/users.html index ac075c3..ab7390e 100644 --- a/web/auth/users.html +++ b/web/auth/users.html @@ -78,6 +78,15 @@
配置后登录页出现「企业 SSO 登录」入口(标准 OIDC 授权码流程); 未配置走本地账号。令牌换会话的后端端点待 IAM 就绪后对接(见 README)。
+
+

角色权限矩阵(PRD 5.7,对齐 rbac.py Resource×Action)

+ + + +
角色查看 view配置 edit发布/回滚 publish用户管理 manage
+
矩阵即前端门控依据:配置台写按钮按会话角色置灰(Viewer 只读 / + Editor 可配置 / Publisher 可发布回滚),本页仅 admin 可见。
+

审计日志(写操作落日志,最近 500 条)

diff --git a/web/auth/users.js b/web/auth/users.js index 89f3bb3..f77c096 100644 --- a/web/auth/users.js +++ b/web/auth/users.js @@ -117,5 +117,31 @@ }; renderUsers(); + renderPermMatrix(); }); + + /* 角色权限矩阵展示(issue #151 验收:矩阵生效可见;与 studio 门控同源) */ + var PERM_MATRIX = { + readonly: { view: true, edit: false, publish: false, manage: false }, + engineer: { view: true, edit: true, publish: false, manage: false }, + admin: { view: true, edit: true, publish: true, manage: true } + }; + function renderPermMatrix() { + var tbody = document.querySelector("#perm-matrix tbody"); + tbody.innerHTML = ""; + UserStore.ROLES.forEach(function (r) { + var tr = document.createElement("tr"); + var td = document.createElement("td"); + td.textContent = UserStore.ROLE_LABELS[r]; + td.className = "role-" + r; + tr.appendChild(td); + ["view", "edit", "publish", "manage"].forEach(function (a) { + var c = document.createElement("td"); + c.textContent = PERM_MATRIX[r][a] ? "✓" : "✗"; + c.style.color = PERM_MATRIX[r][a] ? "#2ecc71" : "#64748b"; + tr.appendChild(c); + }); + tbody.appendChild(tr); + }); + } })();