The CreatorCon Call for Content is officially open! Get started here.

Restrict users with "sn_hr_core.case_writer" to access interaction records belonging to Global scope

Community Alums
Not applicable

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

 

3 REPLIES 3

Sandeep Rajput
Tera Patron
Tera Patron

@Community Alums Please create a Query BR on the interaction table as follows.

 

Screenshot 2024-01-24 at 12.46.54 AM.pngScreenshot 2024-01-24 at 12.47.15 AM.png

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);

Community Alums
Not applicable

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

@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.