How to make a catalog item only visible for Manager in Service Portal

IndiraH
Tera Contributor

I have a requirement to make a catalog item visible only to managers on the service portal and hide it from general end-users. I don't see any field in the user record that indicates manager same as affiliation type example ( employee, temp staff). Any idea how to filter out only the manager.

1 ACCEPTED SOLUTION

JP - Kyndryl
Kilo Sage

Hi Indira,

I would create a user criteria "User is a manager" with this script:

answer = checkIfManager();

function checkIfManager(){

var gr = new GlideRecord('sys_user');
gr.addQuery('manager', gs.getUserID());
gr.query();

return gr.hasNext();

}

and associate this User Criteria in the Access > Avalaible for   on the Catalog Item using the Catalog Builder.

 

Regards,
JP

View solution in original post

2 REPLIES 2

JP - Kyndryl
Kilo Sage

Hi Indira,

I would create a user criteria "User is a manager" with this script:

answer = checkIfManager();

function checkIfManager(){

var gr = new GlideRecord('sys_user');
gr.addQuery('manager', gs.getUserID());
gr.query();

return gr.hasNext();

}

and associate this User Criteria in the Access > Avalaible for   on the Catalog Item using the Catalog Builder.

 

Regards,
JP

Ravi Chandra_K
Kilo Patron
Kilo Patron

Hello @IndiraH 

Greetings!

Is the form record producer?

Check if there is existing user criteria for managers and add it to the Available for in the form.

If not, create one as Kyndryl mentioned 

 

please mark the answer as correct and helpful if helped!

Kind Regards,

Ravi Chandra.