Granting Access to Users With No Role

thisisauniqueus
Giga Expert

Hi,

I have a custom table say for example custom_donors (and its default role custom_donoros_user) and its has fields like

custom_donors.name1

custom_donors.name2

these fields are actually reference fields of sys_user table. I have created a report "My Donors", which has a filter like

custom_donors.name1 javascript:gs.user_id()

OR

custom_donors.name2 javascript:gs.user_id()

I have created a module My Donor Module in which the report My Donors is displayed. So far so good. Now the problem is that some users to which i have to show the report via the module do not have any role or part of any group. so they do not see the module My Donor Module in the left navigation menu.

My question is how can i grant users without any role the access to the module My Donor Module (so its displayed in the left menu) and to the corresponding records of custom_donors. Probably an ACL? Please guide me to resolve this issue.

P.S if you have read this rather lengthy question i am really grateful

Best Regards,

John

1 ACCEPTED SOLUTION

Abhinay Erra
Giga Sage

Yes, you can create a new Read ACL on the custom table and put these in the conditions.


custom_donors.name1 javascript:gs.user_id()


OR


custom_donors.name2 javascript:gs.user_id()



For the Module to show up in the left pane, go to modules and serach for the your module and delete the roles in there as shown below


find_real_file.png


You will also do the same thing for Applications as well. Go to the Applications and find your application and remove the roles.


View solution in original post

9 REPLIES 9

mrswann
Kilo Guru

why not create a custom role ?


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi John,



You can either place this custom module under OOTB "Self service" menu or make sure application menu or module created has a blank role.


Reference :


Administering Application Menus and Modules - ServiceNow Wiki



Please let us know if you have any additional questions.


Thank you Pradeep for your time. Can i duplicate my module that is one i keep under the same application menu with roles and for users with no role i can move it to Self Service application menu, if yes then how?



Regards


arpitt
Tera Expert

Add those specific end users to a group and make the module visible to that particular group. Please refer below BR:



Write a "Before" Query BR on sys_app_module table with below code:



function onBefore(current, previous) {


    //This function will be automatically called when this rule is processed.


  if(!gs.getUser().isMemberOf('GROUP') && !gs.hasRole('admin'))


  {


      current.addQuery('sys_id','!=','99a43ce84f70e2007ac12f9ca310c71c');//sys_id of the module


}


}


Abhinay Erra
Giga Sage

They need to have read access to that table too. Give them read access to the project table, then you are good to go.