Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Write a Condition that Hides Items in SP Menu

codechaser
Giga Expert

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!

1 ACCEPTED SOLUTION

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.

View solution in original post

10 REPLIES 10

That did it - thank you!