How to restrict catalog item for user country

prasadsnow
Tera Contributor

Hi Friends

I am working on some catalog item, and I have to restrict this catalog item based on user country,

I have tried using available with advance script like below, but its not working, 

Any idea, or any other way we can achieve this?

find_real_file.png

1 ACCEPTED SOLUTION

Kieran Anson
Kilo Patron

Hi,

Try this instead:

checkCondition();

function checkCondition(){

var user = new GlideRecord('sys_user');
user.get(gs.getUserID());

if (user.location.country == "USA")
{
     return true;
}
     return false;
}

View solution in original post

7 REPLIES 7

Kieran Anson
Kilo Patron

Hi,

Try this instead:

checkCondition();

function checkCondition(){

var user = new GlideRecord('sys_user');
user.get(gs.getUserID());

if (user.location.country == "USA")
{
     return true;
}
     return false;
}

Thanks for replay, but no luck Kieran,

No luck as in its allowing all users to see the item or preventing all users to see the item?

Catalog visible to every one