Built-in module · WS runtime · 08/7/2026

system — System — quyền hạ tầng (manifest-only) BUILT-IN

Module manifest-only (không code): khai permission cho năng lực hạ tầng vào taxonomy 4 cấp để RBAC gán được — route thật ở core. Nguyên tắc: thêm năng lực core mới = thêm 1 dòng permission ở system.

🎯 Pattern chuẩn — mở rộng dần. Hiện trạng: chỉ phủ install/delete module. Đích = mọi năng lực hạ tầng WS đều có permission trong taxonomy, không hardcode ngoài luồng.
1

Feature / BO / Action

FeatureBO chínhAction
modulesQuản lý ứng dụng (cài/gỡ/bật/tắt)viewinstalldelete
backupBackup per-WS (gắn P3 review)viewrestore
auditNhật ký hệ thống (khi có audit platform)viewexport
healthTình trạng module / kết nốiview
notify-channelCấu hình kênh gửi (Zalo OA/SMS)viewconfigure
2

Manifest — khai báo permissions

Permission key theo convention system.<group>.<feature>.<action>. fields/scopeVars theo plan data-scope (manifest v1.1).

{ "key": "system", "name": "Hệ thống (manifest-only)", "version": "1.1.0 (đích)", "permissions": [ { "group": "admin", "feature": "modules", "label": "Quản lý ứng dụng", "actions": [ "view", "install", "delete" ] }, { "group": "admin", "feature": "backup", "label": "Backup workspace", "actions": [ "view", "restore" ] }, { "group": "admin", "feature": "audit", "label": "Nhật ký hệ thống", "actions": [ "view", "export" ] }, { "group": "admin", "feature": "health", "label": "Tình trạng module", "actions": [ "view" ] }, { "group": "admin", "feature": "notify-channel", "label": "Kênh thông báo", "actions": [ "view", "configure" ] } ] }
3

Dữ liệu chính

▸ Danh mục quyền hạ tầng (đích)

TrườngKiểuBắt buộcGhi chú
modules.view / install / deletepermissionĐã có — routes/modules.js
backup.view / restorepermissionThêm cùng P3 (pg_dump per-WS)
audit.view / exportpermissionThêm khi có audit platform
health.viewpermissionHealth-check module sau mount
notify-channel.configurepermissionCấu hình Zalo OA/SMS tách khỏi QTHT chung

▸ Cơ chế

TrườngKiểuBắt buộcGhi chú
Permission keysystem.admin..Cùng format module thường
Đăng kýstub từ manifestruntime-core — không models/routes
Gán mặc địnhrole owner/QTHTKhông rơi vào role nghiệp vụ
4

Ma trận quyền — vai trò × feature

Vai trò theo WS0. R xem · W tạo/sửa · A duyệt · — không có quyền.

FeatureQTHTGIAM_DOCQL_DAO_TAOTUYEN_SINHGIAO_VUGIAO_VIENKE_TOANNHAN_SU
modulesWR
backupWR
auditRR
healthRR
notify-channelW

¹ chỉ bản ghi mình phụ trách · ² chỉ của chính mình · W·A = tạo/sửa + duyệt

5

Quy tắc nghiệp vụ & liên kết

Quy tắc

  • Mọi route hạ tầng mới bắt buộc gate bằng permission khai ở system — không hardcode ngoài taxonomy
  • Quyền system mặc định chỉ gán owner/QTHT
  • Feature backup/audit/health thêm dần theo tiến độ — bump version manifest như module thường

Liên kết chéo

  • rt-host — thực thi install/delete/health
  • cp-workspace — backup per-WS (P3)
  • notify — kênh gửi
  • cp-rbac — catalog nhận quyền

⚠ Câu hỏi mở

  • Chốt danh sách feature hạ tầng đợt đầu: modules + backup + health?