HR Leave · Australia

ACLs — صلاحيات تطبيق الإجازات

ServiceNow Australia · Custom app · Arabic + English readable · scripts copy/paste ready

App typeCustom
Scopex_786686_hr_leave
sys_idc84db0e8839f0b509f02b0d6feaad3c9
Replace{BASE} = your instance
Instance URLs Application Leave requests Business Rules Studio

ACLs — صلاحيات تطبيق الإجازات

أنشئ كل ACL من:
All > System Security > Access Control (ACL) — Open direct
فعّل High Security أولًا.

القاعدة العامة

كل ACL تستدعي Script Include للأمان.


ACL 1 — read على طلب الإجازة

Script:

answer = new x_786686_hr_leave.HRLXProSecurityUtilsV2().canReadLeave(current);

ACL 2 — write على طلب الإجازة

Script:

answer = new x_786686_hr_leave.HRLXProSecurityUtilsV2().canWriteLeave(current);

ACL 3 — create على طلب الإجازة

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

Script:

answer = gs.hasRole('x_786686_hr_leave.hr_admin');

اختبار

بعد إنشاء كل ACL اختبرها عبر Impersonate لكل دور.
Navigate: All > User Administration > Impersonate User — Open direct