Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

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

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

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

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.