FR-132 前端路由進入權限對照(盤點二)

前端路由進入權限對照

每一頁都有一道進入門檻,定義在後端 ui_routes+route_capabilities,前端只讀 /users/me/capabilities 的 routes 名單、不寫死哪頁要哪顆。這張表是 FE 路由檔(src/config/router/index.js)每條具名路由的登記結果,登記 SQL 是 scripts/sql/2026-10-07-fr132-route-entry-capabilities.sql,守衛測試 test/test_fr132_route_entry_registered.py 逐條核對。

§1

規則

  • 內頁的進入權限=它主要動作那顆:新增頁 create、編輯頁 update、檢視頁 read。不跟著所屬側欄頁走——否則有檢視權限就進得了新增頁,送出才 403。
  • 每頁恰一顆 ALL。新增與編輯共用一支表單的頁:ALL=create,另綁 ANY=update(可見判定是「任一 ANY 命中或全部 ALL 滿足」,兩者有其一就進得去)。
  • 內頁 is_menu=false:不上側欄,但照樣進可進頁名單與角色「可見頁面」預覽(標「非選單頁」)。
  • 內頁 pid 掛母頁、不掛分組:母頁取 FE 路由 breadcrumb 的 parent,一律是側欄頁或已登記的內頁(可多層)。角色樹靠它長「分組 › 側欄頁 › 內頁」;掛分組時內頁會跟側欄頁並排,看起來像重複權限。側欄 /user/web-menu 先濾 is_menu、可見判定只看 route_capabilities,都不受 pid 影響。沒有單一母頁的 home、survey-v2-fill 刻意留在分組下。母頁登記在 scripts/sql/2026-10-08-fr132-inner-page-parent.sql,守衛測試核「每支內頁都有母頁、母頁是頁不是分組」。
  • 專案內頁只擋公司層權限,專案角色(manager/auditor/reviewer)由頁內資料層判斷,不在這一層。
  • 路由 name 必須與 DB ui_routes.name 一字不差。
§2

側欄頁(既有,進入權限不變)

FE name 與 DB name 不同的五支,FE 改名對齊 DB(DB 名已被三個套件的 home_route 引用):project-my-tasks→my-tasks、project-my-audits→audit-manage、project-summary-report→report-manage、survey-v2-manage→survey-manage、smtp-config-manage→smtp-config(原本叫 smtp-config 的表單頁改名 smtp-config-form)。麵包屑顯示文字的 i18n key 不動。

route name 進入權限(ALL)
project-dashboard、my-tasks、license-status 無(刻意全登入者可見)
project-list grc.project.read
audit-manage grc.audit.read
report-manage grc.summary-report.read
module-frame oscal.resource-library.read
compliance-framework-manage oscal.framework.read
tool-plugin-manage detection.plugin.read
detection-profile-manage detection.profile.read
flow-template-manage flow.template.read
bulletin-list workspace.bulletin.read
bulletin-manage workspace.bulletin.create
survey-manage survey.survey.read
system-feedback-manage workspace.feedback.read
system-feedback-view workspace.feedback-review.read
tenant-manage iam.tenant.read
department-manage iam.org-unit.read
user-manage iam.user.read
access-roles iam.role.read
access-assignments iam.user.read
system-menu-manage system.system-menu.read
information-system-manage asset.information-system.read
device-manage asset.device.read
scan-zone detection.scan-zone.read
remote-agent-manage detection.remote-agent.read
user-log platform.api-log.read
ai-call-log ai.call-log.read
support、storage-config、drive-app-config system.storage-config.read
smtp-config system.smtp-config.read
security-policy system.security-policy.read
ldap-config system.ldap-config.read
log-forwarding system.log-forwarding.read
ai-service-config ai.ai-provider-config.read
ai-quota ai.quota.read
issue-integrate-config system.issue-integrate-config.read
notify-config system.notify-config.read
cloud-integrations evidence.cloud-integration.read
ai-dashboard ai.dashboard.read
license-manage platform.license.read
§3

內頁(44 支,is_menu=false)

依據欄:「盤點表」=a6-button-capabilities.md 該頁按鈕列;「附錄 A」=a1-capability-tree.md 附錄 A 該頁主要 API。

route name path 母頁 進入權限 依據 待確認
bulletin-form /bulletin/bulletin-form bulletin-manage ALL create/ANY update(workspace.bulletin) 盤點表 BulletinForm:310 儲存=create/update
bulletin-view /bulletin/bulletin-view bulletin-list workspace.bulletin.read 唯讀檢視頁
system-feedback-form /feedback/system-feedback-form system-feedback-manage ALL create/ANY update(workspace.feedback) 盤點表 SystemFeedbackForm:455
system-feedback-viewer /feedback/system-feedback-viewer system-feedback-manage ALL workspace.feedback.read/ANY workspace.feedback-review.read 附錄 A /feedback/<uid> GET;從「系統回饋管理」進的人只有 feedback-review.read
survey-v2-designer /survey/designer/:id survey-manage survey.survey.update 盤點表 SurveyDesigner 全為 update
survey-v2-preview /survey/preview/:id survey-manage survey.survey.read 設計者預覽,寫入鈕全隱藏
survey-v2-fill /survey/fill —(掛分組) grc.job.read 盤點表 SurveyPreview 填答鈕全為 grc.job.update;來填的是任務執行者 ⚠ 用 job.read 而非 survey.read
project-summary-report-tab-view /project-summary-report/report-tab-view report-manage grc.summary-report.read 同頁檢視與編輯,以檢視為主
project-summary-report-history /project-summary-report/history report-manage grc.summary-report.read 歷史版本檢視;還原鈕另判 update
project-create /project/projects/new project-list grc.project.create 附錄 A /oscal-project/start
project-ap-list /project/projects/:id project-list grc.project.read 專案內頁檢視 ⚠ 專案內頁一律 project.read
project-auditor-overview(含 -round/-ap) /project/projects/:id/overview 等三條 project-ap-list grc.project.read 同上 ⚠
project-settings /project/projects/:id/settings project-ap-list grc.project.update 盤點表三個 panel 儲存皆 project.update ⚠ 參與者只看設定也會擋
project-planning(含 -round/-ap) /project/projects/:id/planning 等三條 project-ap-list grc.project.read 檢視為主,寫入鈕另判 ⚠
project-ssp-import-docx /project/projects/:id/ssp-import-docx project-ap-list oscal.ssp.import 附錄 A /ssp-docx-imports/parse(SSP 目標)
project-ap-authoring-round …/round/:roundUid/ap-authoring project-ap-list grc.audit.read 稽核計畫檢視,readonly 時也要能看
project-audit-review-round …/round/:roundUid/audit project-ap-list grc.audit.read 同上
project-poam-round …/round/:roundUid/poam project-ap-list grc.audit.read 同上
auto-classify-list/-batch …/auto-classify(/:batchUid) list → project-ap-list;batch → auto-classify-list evidence.classification.read 列表與批次檢視
evidence-batch-review …/evidence-batches/:batchUid/review/:runUid auto-classify-list evidence.classification.read 審閱檢視,儲存另判 update
home /home —(掛分組) oscal.resource-library.read 渲染資源庫列表(ModuleFrame.vue) ⚠ 疑似舊入口,是否該刪
workflow-setup /workflow/workflow-setup flow-template-manage(專案情境 workflow-setup-project → project-ap-list) oscal.resource-library.read 四支頁以程式開,含 readonly 檢視 ⚠ 專案規劃頁也會開它,持 project.read 但無 resource-library.read 的人進不去
module-frame-items /module-frame/module-frame-items module-frame oscal.resource-library.read 唯讀逐層瀏覽
module-frame-template-edit /module-frame/:uid/template-edit module-frame oscal.resource-library.update 範本編輯
module-frame-import-docx/-excel /module-frame/import-docx、import-excel module-frame oscal.resource-library.create 附錄 A 用檔案新建
module-frame-import-docx-update/-excel-update /module-frame/:uid/import-… module-frame oscal.resource-library.update 附錄 A 既有資源庫
module-frame-import-excel-preview /module-frame/import-excel/preview/:parseUid module-frame ALL resource-library.create/ANY update 新建與更新共用預覽
compliance-framework-version-manage /compliance-framework/compliance-framework-version-manage compliance-framework-manage oscal.framework.read 版本列表
compliance-framework-import-version /compliance-framework/import-version/:parseUid? compliance-framework-version-manage oscal.framework.import 附錄 A parse-jobs
compliance-framework-version-edit /compliance-framework/framework-version/:uid/edit compliance-framework-version-manage oscal.framework.update 盤點表 FrameworkArticleContent 編輯頁
flow-template-create /flow/template-manage/new flow-template-manage flow.template.create 新增頁
flow-template-edit /flow/template-manage/:uid flow-template-manage flow.template.update 編輯頁 ⚠ 內建範本唯讀檢視也走這頁,只有 read 的人進不去
detection-profile-controls /plugin/detection-profile-manage/versions/:versionUid/controls detection-profile-manage detection.profile.read 控制項清單檢視
user-form /auth/user-form-mtrbac user-manage ALL iam.user.create/ANY iam.user.update 新增與編輯共用
access-role-new /access/roles/new access-roles iam.role.create 新增頁
access-role-detail /access/roles/:uid access-roles iam.role.read 明細檢視(含內建角色唯讀)
smtp-config-form /system/smtp-config smtp-config ALL system.smtp-config.create/ANY update 新增與編輯共用
§4

免登記(15 支)

不需要權限就該進得去的頁。前端 src/config/router/routeAccess.js 的 ROUTE_ACCESS_EXEMPT 與 BE 守衛測試的 EXEMPT 是同一份,改一邊要改兩邊。

route name 理由
login、otp-verify、reset-password、forget-password 尚未完成登入
setup-wizard 落地版首次開通,系統還沒有帳號
system-locked 完整性鎖定頁,可能拿不到 token
notfound、forbidden 404/無權限頁本身
license-activation 無照租戶登入後被導來開通,此時沒有任何模組權限
user-profile 本人資料,任何登入者都要能改自己的密碼與暱稱
about 版本資訊
sitemap 只列 web-menu 已過濾的頁,本身不洩漏資料
analysis 前端假資料展示頁,不打 API ⚠ 疑似孤兒頁
role-manage、role-form 舊網址 redirect,由目的頁把關
§5

待首腦確認

  1. 專案內頁一律 grc.project.read(13 條):稽核員只要有專案讀取就進得去,專案角色交給頁內判斷。另一種做法是規劃頁要 grc.job.read、輪次三頁要 grc.audit.read 外加 project.read,但「每頁恰一顆 ALL」放不下兩顆。
  2. survey-v2-fill 用 grc.job.read:填答者是任務執行者,沒有問卷管理權限。
  3. project-settings 用 grc.project.update:只有讀取權限的參與者連看設定都進不去。
  4. flow-template-edit 用 update:內建範本的唯讀檢視也走這頁,只有 flow.template.read 的人點「檢視」會被擋;若要放行,改成 ALL read+頁內唯讀。
  5. workflow-setup 用 oscal.resource-library.read:專案規劃頁也會開它(看任務流程),持 grc.project.read 但沒有資源庫讀取的人會被擋。
  6. home、analysis、sitemap 是否為孤兒頁:home 渲染資源庫列表、無任何程式導向;analysis 是假資料展示頁。建議另開清理卡。