Restrict users with "sn_hr_core.case_writer" to access interaction records belonging to Global scope
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2024 10:00 AM
Hi All,
Requirement is that Users with "sn_hr_core.case_writer" role should only see interaction records belonging to "Human resource core scope" and not the interaction records belonging to "Global" scope.
Please help.
Thanks
Anu

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2024 11:18 AM
@Community Alums Please create a Query BR on the interaction table as follows.
Here is the script.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if(!gs.hasRole('admin')&&!gs.hasRole('sn_hr_core.admin')&&gs.hasRole('sn_hr_core.case_writer')){
current.addEncodedQuery('application!=global');
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2024 02:24 AM
Hi @Sandeep Rajput ,
I tried your solution but after applying this, end users were not able to reply in virtual agent in the portal, the input box was disabled.
Thanks,
Anu

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2024 03:12 AM
@Community Alums The change I suggested was about creating a business rule on the interaction table to filter out the records from the global application for users having sn_hr_core.case_writer role. This business rule can't set the readOnly property for the input box in virtual agent.
Please check if the issue is occurring due to any ACLs.