ACLs — صلاحيات تطبيق الإجازات
أنشئ كل ACL من:
All > System Security > Access Control (ACL) — Open direct
فعّل High Security أولًا.
القاعدة العامة
- الموظف يرى/يعدّل طلبه فقط.
- المدير/المعتمد يرى طلبات فريقه ويعتمدها.
- HR admin يرى ويعدّل كل شيء.
كل ACL تستدعي Script Include للأمان.
ACL 1 — read على طلب الإجازة
- Type: record
- Name: x_786686_hr_leave_req_v2
- Operation: read
- Requires role: (اتركها فارغة لأن المنطق في السكربت)
Script:
answer = new x_786686_hr_leave.HRLXProSecurityUtilsV2().canReadLeave(current);
ACL 2 — write على طلب الإجازة
- Type: record
- Name: x_786686_hr_leave_req_v2
- Operation: write
Script:
answer = new x_786686_hr_leave.HRLXProSecurityUtilsV2().canWriteLeave(current);
ACL 3 — create على طلب الإجازة
- Type: record
- Name: x_786686_hr_leave_req_v2
- Operation: create
- Requires role: x_786686_hr_leave.employee
Script:
answer = gs.hasRole('x_786686_hr_leave.employee')
|| gs.hasRole('x_786686_hr_leave.hr_admin')
|| gs.hasRole('x_786686_hr_leave.integration');
دور x_786686_hr_leave.integration يسمح لمستخدم التكامل hrlx.integration بإنشاء طلب عبر Scripted REST / Table API.
Setup:
src/server/rest/SCRIPTED_REST_INBOUND_SETUP.md (Phase 1 + 5)
ACL 3b — Scripted REST Default ACL (execute on API)
Separate from table ACL — controls who can call the REST endpoint. — هذا ACL مختلف — يتحكم في من يستدعي الـ API (ليس إدراج الجدول فقط).
Create from Scripted REST → Security → Default ACLs (lock icon):
| Field | Value |
|---|---|
| Type | scripted_rest_api |
| Operation | execute |
| Active | true |
| Requires role | x_786686_hr_leave.integration |
| Application | HR Leave |
Lab: add admin role temporarily for Explorer testing as admin.
ACL 4 — حقل المعتمد للقراءة فقط لغير HR
- Type: record
- Name: x_786686_hr_leave_req_v2.u_approver_user
- Operation: write
Script:
answer = gs.hasRole('x_786686_hr_leave.hr_admin');
اختبار
بعد إنشاء كل ACL اختبرها عبر Impersonate لكل دور.
Navigate: All > User Administration > Impersonate User — Open direct