With Employee Document Management plugin, a UI action comes with HR plugins enabled named 'Move Attachments'. Employee documents can be added directly to the employee document repository. The employee document repository provides a central repository for quick and easy identification using different sorting features. See Create or modify an employee document.
For some non-admin users, it was reported that the popup modal that open when clicked the 'Move attachment' button, a lot of time is taken to fully load the form. For admins, it does not take that much.
Primarily, this is mostly caused by slow ACLs. For the record/sn_hr_ef_employee_document/write evaluation as part of get_doc_types_for_selection, there are 2 ACLs:
For the first one, the ACL checks whether the user has the role sn_hr_ef.admin or not.
If this fails, the system checks the second ACL, where it checks if the user has sn_hr_ef.document_writer role or not AND also it calls a Script Include and its method
[ sn_hr_ef.ef_SecurityUtils(current).canWrite() ]
For admins the first ACL will pass, so ACL evaluation time will be less.
For non-admins, below logs might appear if debug security and debug log is enabled from Session Debug:
14:04:32.397 EXCESSIVE *** End #90168 /api/sn_hr_ef/employee_files/get_doc_types_for_selection, user: firstname.lastname@example.org, total time: 0:00:20.309, processing time: 0:00:19.967, total wait: 0:00:00.342, session wait: 0:00:00.342, SQL time: 0:00:02.773 (count: 4,459), ACL time: 0:00:19.528, source: 220.127.116.11 , type:rest, method:GET, api_name:sn_hr_ef/employee_files, resource:sn_hr_ef/employee_files/get_doc_types_for_selection, version:Default, user_id:<sys_id of the user>, response_status:200
As seen from the logs, the time is taken most is by the ACL evaluation. So below log will also appear:
log14:04:31.802 Slow ACL 0ace9ecd9302030092051d1e867ffb61 for the path record/sn_hr_ef_employee_document/write, time was: 17
The ACL may be passing for the user, but the time to evaluate the script of the ACL is taking up a lot of time. Hence the slowness in viewing the modal.
As a solution, the customer can either
a. provide the users with the role sn_hr_ef.admin, or
b. they can modify the ACL to add another role which the users have (Not recommended as it will update OOB ACL) or
c. Create a similar ACL with the role that users have already.