12/22/2022 09:34 PM
Hi Team,
We have 2 kinds of employees PERMANENT and EXTERNAL
We created a role called "ROLE _MANAGER"
We want to restrict this manager role " Whom to Request " to only external accounts for whom the request is a manager
This is the query we are using
select a from Users a where a.statuskey=1 and a.manager=${users.id} and a.employeeType = 'External'
Can Team help me to improve the query so that manager can only request external accounts?
Solved! Go to Solution.
12/22/2022 10:45 PM
Please try with the below:
select a.id from Users a where a.statuskey=1 and a.manager='${users.id}' and a.employeeType = 'External'
12/22/2022 11:36 PM
Hi Kirti
Your suggested query did not help.
Managers can still request PERMANENT employees, which were assigned to them.
12/23/2022 12:19 AM - edited 12/23/2022 12:37 AM
How many sav roles user have?
use json instead of hql
12/23/2022 03:20 PM
Can you confirm that manager has only ROLE_MANAGER? If not make sure that other SAV ROLES are not having any conflicting configuration.
If user has only Manager SAV Role then can you try to change the query like below
select a from Users a where a.statuskey=1 and a.manager=${user?.id} and a.employeeType = 'External'