- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2018 07:28 AM
Looking for a condition that will hide items from displaying in the Service Portal Header Menu. Right now, I have something that looks like this... GlideSPScriptable.canSeePage("services_status") && gs.getUser()... but need to restrict access, based-on those who are a member of a Department.
Thank you!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2018 10:28 PM
Condition should be GlideSPScriptable.canSeePage("services_status") && new bsu_system_status().getMyDepartmentID()
Use below script
var bsu_system_status = Class.create();
bsu_system_status.prototype = {
initialize: function() {
},
getMyDepartmentID: function() {
if (gs.getUser().getDepartmentID() == 'sysID1' || gs.getUser().getDepartmentID() == 'sysID2' || gs.getUser().getDepartmentID() == 'sysID3')
return true;
else
return false;
},
type: 'bsu_system_status'
};
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2018 07:36 AM
You can write
GlideSPScriptable.canSeePage("services_status") && gs.getUser().getDepartmentID() == 'sys_id of the department who should see status page'
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2018 01:09 PM
This works but am curious if you can include multiple departments in the same condition and what that might look like?
Thanks again!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2018 01:17 PM
GlideSPScriptable.canSeePage("services_status") && (gs.getUser().getDepartmentID() == 'sys_id1' || gs.getUser().getDepartmentID() == 'sys_id2' || gs.getUser().getDepartmentID() == 'sys_id3')
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2018 09:11 AM
Thanks! Oddly enough, it doesn't work for the other two groups, but does for the one. Perhaps a function call would be easier?