Limit catalog items to users with specific job title

BrianS344076034
Tera Guru

I think I have 2 ways to tackle this, but looking to do it the easiest way

I have a list of catalog items that we want to limit to users that are in a specific location or have their job title contains a key word

When I look at the options to build this, i see the following

BrianS344076034_0-1770839963387.png

So I know I can do Location = "Head office" and Im good for that requirement.

For the second, I feel like there are 2 options

Option 1 - create a group in SN for all the users and manually have to keep it updated, then add that group to this Available for access

Option 2- if I click advanced there is a script option

Can this be scripted to be

Logged in user's job title contains General Manager ?

 

 

 

1 REPLY 1

velluri
Tera Contributor

Yes, You can use the option 2 by writing the Script .
//Sample Script

var userID = gs.getUserID();
var checkDep = new GlideRecord('sys_user');
checkDep.addQuery('sys_id', userID);
checkDep.query();
if (checkDep.next()) {
    if (checkDep.department.getDisplayValue() == 'IT') {  // can replace the Department with jobtitle
        answer = true;
    } else
        answer = false;
}