Restrict Now Assist AI Search results to specific users

simonthomas
Tera Expert

I am preparing to trial Now Assist in AI Search on our Employee Center for a limited group of users. I have enabled Now Assist Multi-Content Response under Now Assist in AI Search and it works well. However, I'm looking for a way to restrict who can see the "Answer generated by Now Assist" panel at the top of the search page. How can I configure this?

1 ACCEPTED SOLUTION

simonthomas
Tera Expert

I have created a solution that is working. The EC Search widget has a parameter

searchFromChat that turns off the Now Assist search results if set to false.

 

1. Clone the EC Search widget

2. Add the following code to the cloned widget:

Server script

data.isAdmin = gs.getUser().hasRole('admin');

 

Client controller

	c.$onInit = function () {
		var isAdmin = c.data.isAdmin;
		if(!isAdmin){
			// Get the parameter from the URL
			var paramValue = $location.search().searchFromChat;

			// If the parameter is missing or empty, redirect
			if (!paramValue) {
				$window.location.href += '&searchFromChat=false';
			}
		}
	};

 

3. Add the cloned widget to the esc_search page.

4. Set the Can View user criteria on the original EC Search widget to my trial group.

5. Set the Cannot View user criteria on the cloned widget to my trial group.

Note: The cloned widget specifically checks for users with the admin role as the user criteria alone wouldn't prevent admins from viewing the cloned widget.

View solution in original post

5 REPLIES 5

simonthomas
Tera Expert

I have created a solution that is working. The EC Search widget has a parameter

searchFromChat that turns off the Now Assist search results if set to false.

 

1. Clone the EC Search widget

2. Add the following code to the cloned widget:

Server script

data.isAdmin = gs.getUser().hasRole('admin');

 

Client controller

	c.$onInit = function () {
		var isAdmin = c.data.isAdmin;
		if(!isAdmin){
			// Get the parameter from the URL
			var paramValue = $location.search().searchFromChat;

			// If the parameter is missing or empty, redirect
			if (!paramValue) {
				$window.location.href += '&searchFromChat=false';
			}
		}
	};

 

3. Add the cloned widget to the esc_search page.

4. Set the Can View user criteria on the original EC Search widget to my trial group.

5. Set the Cannot View user criteria on the cloned widget to my trial group.

Note: The cloned widget specifically checks for users with the admin role as the user criteria alone wouldn't prevent admins from viewing the cloned widget.