I want to hide Standard Change link in Change Request Interceptor if logged in user is in specific group

rpoola
Tera Contributor

Hi,

I want to hide Standard Change link in Change Request Interceptor if logged in user is in specific group.How can I achieve this.I have tried in calling method in the Script Include which returns true or false but it is not working.

 

 

Thanks

Ravi

1 ACCEPTED SOLUTION

The only way you could hide this on basis of group is a query business rule on sys_wizard_answer table. 

if(gs.getUser().isMemberOf('group_sys_id')){      //restrict for a particular group

current.addQuery('name','!=','answerName');

}

View solution in original post

13 REPLIES 13

Jaskaran Walia
Kilo Guru

 

@rpoola

 

I think the easy way to achieve the same result is to make standard change link visible to selected role and then don't assign that role to that specific user in that group. You won't need any scripting.

 

See the attached document how to do this. There is scripting field in interceptor, you can use it if you want but controlling it by role is easy for future maintenance as well.

 

Hope this helps if so, please mark the answer as correct.

 

rpoola
Tera Contributor

Thank you Jaskaran for immediate reply. In my case it is different scenario. As per requirement I need to hide link based on group. I am wondering how can I achieve this using Script. I have tried in different ways but not worked.

The only way you could hide this on basis of group is a query business rule on sys_wizard_answer table. 

if(gs.getUser().isMemberOf('group_sys_id')){      //restrict for a particular group

current.addQuery('name','!=','answerName');

}

Hi Gurpeet,

 

I am trying to achieve same on Knowledge table. I have Knowledge template wizard and under that I have 2 answers say A and B.Out of that I want answer A to be visible to particular group members only.

 

As you suggested, I wrote async  BR on "sys_wizard_answer" table. But this is not executing.

 

Because when I click on "create new" button , I am still able to see both templates.

 

 

Kindly help. Thanks in advance.