Files
alla-tms/docs/permission-test-matrix.md
2026-07-16 09:53:14 +07:00

7.6 KiB

Permission Test Matrix

Persona ที่ใช้จริงในระบบ

Persona System / Membership Role Business Role
Super Admin systemRole = super_admin IT
HRD Admin membership owner หรือ admin HRD
Employee membership member EMPLOYEE

Capability Matrix

Module / Capability Super Admin HRD Admin Employee หมายเหตุ
Login Allow Allow Allow ทุก persona ต้อง login ได้
Dashboard Overview Allow Allow Allow เนื้อหาต้องต่างกันตาม scope
Organizers Allow Deny Deny ระดับระบบ
Users List / Create / Edit Allow ตาม implementation ปัจจุบัน HRD menu Deny nav และ route ต้องสอดคล้องกัน
Employee Directory Allow Allow Deny ขอบเขตองค์กรเท่านั้น
Courses Allow Allow Deny ระดับจัดการข้อมูลหลัก
Training Policy Allow Allow Deny
Training Matrix Allow Allow Deny
Training Record - Create for Self Allow Allow Allow employee จำกัดเฉพาะของตนเอง
Training Record - Create for Others Allow Allow Deny
Training Record - Review Allow Allow Deny pending review
Training Record - View All Allow Allow Deny employee เห็นเฉพาะตนเอง
Certificate Upload Allow Allow Allow เฉพาะ record ที่ policy อนุญาต
Announcements Manage Allow Allow Deny employee อ่านอย่างเดียว
Announcements Read Public Allow Allow Allow published + active window
Online Lessons Manage Allow Allow Deny employee อ่านอย่างเดียว
Online Lessons Read Public Allow Allow Allow is_published = true
Reports Organization Scope Allow Allow Deny employee self only
Reports Self Scope Allow Allow Allow
Reports Export Excel/PDF Allow Allow Allow แต่ข้อมูลต้อง respect scope
Notifications Read Allow Allow Allow
Notifications Mark Read Allow Allow Allow
Import Employees Allow Allow Deny
Master Review Allow Allow Deny
Permission Templates Allow Deny Deny super admin only ตาม nav/access
User Permissions Allow Deny Deny super admin only
Permission Audit Logs Allow Deny Deny super admin only
Audit Logs Allow Deny Deny super admin only

Permission Test Checklist

Test ID Check Expected
PM-001 Super Admin เปิด /dashboard/permissions/templates เข้าถึงได้
PM-002 HRD Admin เปิด /dashboard/permissions/templates ถูกปฏิเสธ
PM-003 Employee เปิด /dashboard/permissions/templates ถูกปฏิเสธ
PM-004 Employee เปิด /dashboard/users ถูกปฏิเสธ
PM-005 Employee เปิด /dashboard/employee-directory ถูกปฏิเสธ
PM-006 Employee เปิด /dashboard/reports เห็นเฉพาะข้อมูลตนเอง
PM-007 Employee เปิด training records ของคนอื่นผ่าน URL/API ถูกปฏิเสธหรือไม่พบข้อมูล
PM-008 Employee แก้ query string report เอง ยังคง self-scope
PM-009 HRD Admin เปิด /dashboard/audit-logs ถูกปฏิเสธ
PM-010 Super Admin เปิด /dashboard/audit-logs เข้าถึงได้
PM-011 Employee เห็น announcement draft ต้องไม่เห็น
PM-012 Employee เห็น online lesson draft ต้องไม่เห็น
PM-013 HRD Admin review pending training record ทำได้
PM-014 Employee review pending training record ทำไม่ได้
PM-015 Employee สร้าง record ให้ user คนอื่น ทำไม่ได้
PM-016 HRD Admin import employees ทำได้
PM-017 Employee import employees ทำไม่ได้
PM-018 Cross-organization access ผ่าน URL หรือ API ต้องไม่เห็นข้อมูลข้าม org

หมายเหตุ

  • role แบบ Staff, Manager, HRD Manager ไม่พบเป็น runtime role จริงใน implementation ปัจจุบัน จึงไม่สร้าง permission matrix แยกให้ในรอบนี้