Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

restrict view of navigation menu

loraine
Kilo Contributor

I would like to restrict the view of a Navigation menu item by role.   I am on Geneva with UI16.

I would like any user with a role not to see a menu item and any user without a role to have the item visible.

I have looked at Unfortunately, you can only   , adding an ACL for sys_app_module.* although I can not get it to work.

The script is:

var myUser = gs.getUser();

var has_group = true;

var grp = new GlideRecord('sys_user_grmember');

grp.addQuery('user', myUser);

grp.query();

if (grp.next()) {

  has_group = false;

}

if (myUser.hasRoles() || has_group == true) {

  current.addQuery('sys_id','!=','111111122222222xxxxxxx');   //my menu item here to hide

}

6 REPLIES 6

Ask just in case to your sales representative.



If I were you I would ask "I create a new role, don't use it on any ACL but only for the navigation menu, so a requester would still have normal requester accesses on the records. Then I give the role to a requester. Is this user still a requester or not?"



As it's only a licence question and not a technical question, it's better to have the answer from the sales representative


Our sales representative has confirmed any user that has a role incurs a licence fee.   Requestor users have no roles associated.