How to hide/Show service Portal menus based on custom Roles (Created in a scoped table)?

ashwanikumar
Tera Expert

Hi All,

i have following tables created to replicate OOTB user access tables:

  • AS Users (refer to the user table)
  • AS Roles
  • AS Groups

I have a table 'Role' created in scoped table and I am using script to map this role to the users table.

How can I restrict Service Portal menu visibility based on custom roles?

Is it possible?

 

Thanks.

KUMAR

 

2 REPLIES 2

Gurpreet07
Mega Sage

Create a script include to return true/false if user is having custom role and then call the same in condition field of menu item.

 

condition: new SIName().functionName()

Ian Mildon
Tera Guru

If it's the Header Menu you're wanting to edit, it is possible to show/hide the entries by adding to the Conditions field.

On our service portal there are two menu items that only show if the logged in user meets the conditions set on the menu item. One is based on their department:

gs.getUser().getDepartmentID() == '6403816bdbc40748c0bc3220ad961921';

While the other is based on if they are a manager:

conds.addEncodedQuery('managerDYNAMIC90d1921e5f510100a9ad2572f2b477fe');