Phần lớn WS0 đã có sẵn ở Control Plane — multi-tenant (workspace), SSO, users, RBAC.
Việc của ta là ánh xạ mô hình tổ chức/vai trò trường lái xe vào RBAC OpenGate và khai permissions[] trong từng module.
| Hạng mục (kế hoạch cũ) | OpenGate cung cấp | Ghi chú |
|---|---|---|
| Multi-tenant | Workspace — mỗi trung tâm 1 workspace, DB riêng (Level 2) | Vĩnh An = 1 workspace; trường sau = workspace mới |
| Users + đăng nhập | Control Plane: User, Membership | Không tự làm bảng user |
| SSO | CP OAuth2 authorization-code, session toàn cục + workspace | Đăng nhập 1 lần, vào nhiều workspace |
| RBAC | CP: Role, RoleGroup, catalog Permission; module khai quyền | Gán role cho user theo workspace |
| Store / cài module | CP Store/Entitlements + runtime cài .ogapp | License thương mại per-workspace |
| Bảng tenant / user / role tự làm | — không cần — | Bỏ khỏi phạm vi tự xây |
Permission key: <key>.<group>.<feature>.<action> — khai trong manifest.json.
Backend chặn qua authorize(...), frontend ẩn/hiện qua hasPermission(...). Action: view, create, edit, delete, export, import, approve, assign, configure, report…
| Module (key) | Feature | Permission (rút gọn) |
|---|---|---|
student | student | student.main.student.{view,create,edit,delete} |
teacher | teacher | teacher.main.teacher.{…} |
vehicle | vehicle | vehicle.main.vehicle.{…} |
course | course | course.main.course.{…} |
dat | device, log | dat.main.device.{…}, dat.main.log.view |
rfcard | card | rfcard.main.card.{…} |
catalog | license, training-category, educational-level, teaching-subject | catalog.main.<feature>.{…} |
Module WS1 mới sẽ thêm feature/permission — vd student.main.hoso.approve, report.main.so-xd.export.
Mỗi vai trò = 1 Role trong CP bó các permission module. Một user gán nhiều role trong workspace (hợp trung tâm nhỏ kiêm nhiệm).
| Vai trò | Role đề xuất | Bó permission chính |
|---|---|---|
| Chủ trung tâm / Giám đốc | director | *.view toàn bộ + *.approve báo cáo + BI |
| QL đào tạo / Giáo vụ trưởng | training_mgr | student/course/teacher/vehicle view/create/edit + course.*.approve + báo cáo Sở create |
| Nhân viên tuyển sinh | admission | student.main.student.{view,create,edit} (tiếp nhận) + CRM |
| Nhân viên giáo vụ | registrar | student.*, course.* create/edit + đối soát DAT view |
| Giáo viên | instructor | student.main.student.view (phạm vi phụ trách) + lịch dạy |
| Kế toán | accountant | công nợ/hóa đơn/lương view/create/edit/approve |
| Nhân sự – Hành chính | hr | teacher + nhân sự/chứng chỉ view/create/edit |
| Kỹ thuật / Xe – sân | fleet | vehicle.*, dat.main.device.* |
| Cán bộ sát hạch (nếu có sân) | exam_op | vận hành kỳ thi (module v2+) |
| Học viên | không phải role CP | truy cập qua app học viên, chỉ dữ liệu của mình |
Control Plane không có khái niệm Department (chỉ User/Role/RoleGroup). Ba lựa chọn:
Chỉ dùng Role để phân quyền. Đơn giản nhất, đủ dùng.
Gom role theo phòng để gán nhanh cho nhân viên.
Chỉ khi cần luồng bàn giao hồ sơ giữa phòng (cột phong_phu_trach_id, phong_tu/den_id ở schema §2). Đặt danh mục phòng trong catalog hoặc student.
runtime-core/base đã có audit log chung chưa?exam_op (v2+)