๐ Getting Started
28 views
User Roles & Permissions
User Roles & Permissions
Sistem ini menggunakan Spatie Laravel-Permission dengan 10 role bawaan:
Role Hierarchy
| Role | Deskripsi | Default Akses |
|---|---|---|
| super_admin | Akses paling tinggi (system level) | Semua |
| owner | Pemilik klinik / multi-branch | Semua modul, switch cabang |
| admin | Admin operasional | Semua kecuali settings sistem |
| doctor | Dokter gigi (umum/spesialis) | EDR, treatment plan, prescriptions, schedule sendiri |
| nurse | Perawat gigi | Assist visit, material usage, sterilisasi |
| front_office | FO / Resepsionis | Patient registration, appointment, basic billing |
| cashier | Kasir | Payment processing, deposit, refund |
| pharmacist | Apoteker internal | Resep & dispensing |
| lab_tech | Teknisi dental lab | Lab case management |
| patient | Pasien | Portal self-service |
Permission Matrix
Permissions di-define sebagai {resource}.{action} (24 resource ร 4 action = 96 permission):
Actions: view, create, edit, delete
Resources:
- clinic, user, patient, appointment, visit
- examination, odontogram, treatment, treatment_plan
- clinical_note, prescription, radiograph
- invoice, payment, insurance, claim
- inventory, purchase_order, lab_case
- reminder, notification, report
- ai, seo, setting, audit
Cara Manage Permission
- Owner login โ
/admin/users - Edit user โ assign role
- Untuk granular permission: edit role di Spatie permission table
Best Practice
- Owner: ke super_admin (semua permission)
- Doctor: assign role doctor + permission spesifik untuk modul specialty mereka
- Front Office: role front_office + permission
appointment.*+patient.view/create - Patient: role patient (otomatis dari register portal)