Prevent access to certain modules

maryc
Tera Contributor

Hi,

I have a requirement to prevent certain modules from being visible for certain roles. For ex- the new role should be able to see certain modules od Discovery menu, but should be restricted to see Schedule and Credentials. How do I hide them for certain roles?

Thanks in advance

9 REPLIES 9

Manik
ServiceNow Employee
ServiceNow Employee

Hi Mary,



This can be achieved by creating read ACL's for the table and in script you can check:



if (gs.hasRole('itil') && gs.hasRole('roleB')){


        answer = false;


}



Thanks,


Manik



PS - Please mark correct, helpful and like if applicable


maryc
Tera Contributor

Manik, that will work on the table level, but I want to prevent the display of Modules.



Am I missing something here?


Manik
ServiceNow Employee
ServiceNow Employee

Hi Mary,



This would restrict access for tables so if the module is created to display records of that table then records won't be visible on clicking module.



I am not quite sure how we can achieve to hide modules if the users have additional privilege of role B as you want that users with role itil should be able to see the modules so if this first condition is true the module would be displayed, as purpose of role is to provide access to users . Here we are trying to use 'roleB' to restrict access.



Thanks,


Manik



PS - Please mark correct, helpful and like if applicable


roshanlalwani
Tera Expert

Sandeep Kumar6
Giga Guru

HI Mary,



You can restrict any user by providing role inside visibility tab of respected module.


Which ever role you have given there , end user should have that role to access this module if you didnt specify any role there than anyone can access that module.


Capture.PNG


Thanks


Sandeep