- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2019 11:47 AM
This request has come up multiple times from individuals so I am trying to get ahead of the curve before it becomes a requirement. We have catalog items that only people in certain positions can see. We have groups with those people in it, and currently those catalog items are made "Available for" those people. However, what people are requesting is for us to show all the catalog items, but if you are not one of the people who are allowed to request it, deny them access somehow. Right now, since people can't see it, they assume it doesn't exist and so they submit an incident to get the request fulfilled or try to manipulate a catalog item they can see to fit their needs.
Any suggestions?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2019 12:50 PM
You could give access to everyone and write a catalog client script that checks if they're X group(s). If they're not, hide all the fields and show a message stating they need to reach out to their rep.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2019 09:36 AM
I used this suggestion but had to implement it a little different. I did on onLoad check and showed a warning message that the user wasn't allowed to order this. However, I couldn't hide any fields because of them being mandatory. So I ended up writing on onSubmit script as well that shows them the same warning message, clears a mandatory variable or two, and aborts the submission.
function onSubmit() {
//Type appropriate comment here, and begin script below
var usr = g_user.userID;
var member = new GlideRecord('sys_user_grmember');
member.addQuery('group=627e59cc0d812f00076d6e8991d53067^ORgroup=00ae954c0d812f00076d6e8991d530d6');
member.addQuery('user',usr);
member.query(group);
return false;
function group(member){
if(!member.next()){
alert("You do not have the proper permissions to request this.");
g_form.clearValue('type');
}
else {
g_form.submit();
}
}
}