Hide Visibility of RITM and SCTASK of 1 catalog item from ITIL users in the console

Community Alums
Not applicable

Hello Experts,

 

We have created a ACL on a sc_req_item table for a service request record to be visible only to a specific group for which we created a custom role. But still users who aren't part of this specific group are able to view service request record in the console.

 

We have ask to hide service catalog and category in service portal for users who aren't part of specific group with custom role which we have fulfilled but the other ask is to hide RITM and SCTASK also from users who aren't part of the specific group with custom role which we created. We created acl on requested item table first but it is not working

 

We have tried out script as well in the ACL of sc_req_item table.

1) answer = gs.hasRole('specific_role_name');

 

 

2) var userGroup = gs.getUser().getMyGroups();
var allowedGroup = 'your_specific_group_sys_id';
answer = userGroup.indexOf(allowedGroup) != -1;

 

3 We have tried a script to block visibility of this 1 catalog item record in console to itil and approver users as well but it didn't workout too.

var user=gs.getUser();
if(user.hasRole('itil')||user.hasRole('approver_user')){
    answer=false;
}else{
    answer=true;
}

 

Kindly provide your suggestions if anyone has achieved working on this type of ask.

 

Thanks.  

2 REPLIES 2

Abhishek_Thakur
Mega Sage

Hello @Community Alums ,

 

Why don't you try the below script.

1) answer = gs.hasRoleExactly('specific_role_name');

2) var userGroup = gs.getUser().getMyGroups();
var allowedGroup = 'your_specific_group_sys_id';
if(userGroup.indexOf(allowedGroup) != -1){
answer=true;
}else{
answer=false;
}

 

Please mark my answer as accepted solution and give thumbs up, if it helps you.

Community Alums
Not applicable

Hi Abhishek,

 

Thanks for quick reply, unfortunately the above didn't work.

 

BR,

Raj