Restrict the availability of a HR service in case creation page in Agent Workspace

Srinath9
Tera Guru

Hi Everyone.

 

How to restrict access for HR services in case creation page in Agent Workspace and Native UI based on Assignment Groups?

Any help is appreciated!

 

Thanks,

Srinath

1 ACCEPTED SOLUTION

Hi @Srinath9 

Sorry your requirement cant be achieved by HR criteria.

Write one Before query BR on HR Service so that it will show only limited HR Services to the end user . 

For example, if you want to show HR Service 'Payroll discrepancy' to HR Payroll group alone then you can use below script in before query BR. 

if(!gs.getUser().isMemberOf('HR Payroll'){  // if logged in user is not member of hr payrolll

current.addEncodedQuery('name!=Payroll Discrepancy);   //this will show all HR Services except Payroll

}

 

If you want to restrict the read and write access to the respective HR Payroll case table then use COE Security Configuration

 

View solution in original post

18 REPLIES 18

Hi @Srinath9 

Sorry your requirement cant be achieved by HR criteria.

Write one Before query BR on HR Service so that it will show only limited HR Services to the end user . 

For example, if you want to show HR Service 'Payroll discrepancy' to HR Payroll group alone then you can use below script in before query BR. 

if(!gs.getUser().isMemberOf('HR Payroll'){  // if logged in user is not member of hr payrolll

current.addEncodedQuery('name!=Payroll Discrepancy);   //this will show all HR Services except Payroll

}

 

If you want to restrict the read and write access to the respective HR Payroll case table then use COE Security Configuration

 

Hi @Srinath9 

Please mark the response as helpful and accept the solution if its resolved your issue

Hi @Sarika S Nair1 ,

 

I haven't got the result I want, please find the below screenshot of the script I have used in before query BR. If there is any change I have to make in the script, please let me know.

 

Srinath9_0-1708004765294.png

 

Thanks,

Srinath

 

Hi @Srinath9 

The BR  script which i shared will restrict the  'Payroll Discrepancy' HR service from all other groups except HR Payroll. I have given sample before query script only. 

As per your HR criteria and HR Service Configuration, I think you are trying to restrict 'HR payroll test service'. In that case you need to modify the script accordingly like below.

 

if(!gs.getUser().isMemberOf('HR Payroll')){  // if logged in user is not member of hr payrolll

current.addEncodedQuery('name!=HR payroll test service');   //this will show all HR Services except HR Payroll test service to the other groups

}

Hi @Sarika S Nair1 , 

 

I checked for the "Payroll Discrepancy" HR service, while logged in as a user who is not part of group "HR Payroll", but I still am able to see the "Payroll Discrepancy" in HR Service. I used your script to validate whether it is working or not, If I'm able to hide a HR service then that's enough for now. Please find the below image for reference.

Srinath9_0-1708006492004.png

 

Do I need to make any changes to Script that we have used in BR? Please let me know if that is the case.

 

Thanks,

Srinath