Hide/show record as per roles

arohi
Kilo Expert

I want to hide records who have a specific type( type is field on form) if it is sla then it should be visible only for those users who have a role as sla.

Tried with some acls. now record info is not visible but the 'i' icon is still there and if user clicks that, it redirects to form. it looks like as below:

find_real_file.png

So in case it is not possible to hide record, atleast after clicking this I icon it should redirect to form only if a user with sla role clicks it. else it shouldn't work for othrt users.

Please suggest how to achieve this.

Thanks in advance

9 REPLIES 9

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Arohi,



Can you please share screenshot of ACL you have created. Also is this a OOTB table?


find_real_file.png



find_real_file.png


This for read and write operations. and yes this table is OOTB


Goran WitchDoc
ServiceNow Employee
ServiceNow Employee

hasRoleExactly is for client side scripting and if that was usable you should have g_user.hasRoleExactly('sla'); but here I think you would need to have gs.getUser().hasRole('sla');



Can read more about it here: https://developer.servicenow.com/app.do#!/api_doc?v=helsinki&id=r_GlideUser-hasRole_String



Only downpart is that if the user has the admin role and not sla role, it will still return true. But I don't think that matters in this case.



//Göran


Sorry to say but it's not working. Records are still there in list view.