How can i hide a custom table(custom app) from admin ?

krishna60
Kilo Contributor

I am trying to hide a custom table from admin. so that table is not shown in the application navigator while searching for it.
I created an ACL read for table and with unchecked admin override and a small script. I even did the same with write, create and delete ACLS(in case they are giving read access by default) but still table is not hidden from admin. any solution please?find_real_file.pnga small script 

10 REPLIES 10

Siddhnath Pande
Mega Guru

Hey Krishna,

there is already answer available on community so please refer this link this might help

https://community.servicenow.com/community?id=community_question&sys_id=8a3b8beddb5cdbc01dcaf3231f96...

If the above code helps then please mark my answer Correct and Helpful.

Thanks and Regards:
Siddhnath Pandey

Admin is having access to the custom table despite not adding to the role list. 

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

don't give anything in roles section; don't give anything in condition; just use advanced and script as below

answer = !gs.hasRole('admin');

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

If role is not mentioned so how would i maintain access to a particular user ?
I am trying to make sure that table has only one access but that is not admin.

Hi Krishna,

but admin inherits all roles; you can give the required role you want if required as you want particular user role to view that table

so if user is admin -> roles section would be true as admin inherits; but script would return false so ACL fails which is correct and table is not accessible

so when user is not admin -> roles section will be true; script section will also give true so ACL passes which is correct table is accessible

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader