How to restrict records to users based on roles and state

kalyani23
Tera Contributor

Hi,

I need to restrict draft state records to users, when the logged in user is not the requestor.

how to achieve this using acls. please let me know

 

Thanks in advance,

Kalyani

 

18 REPLIES 18

Hello @kalyani23 ,

 

you have to change it on existing read acl if that read acl allowing access to users if there is no such ootb acl then create new one

 

If it helps, Kindy click on like icon and mark it as accepted solution

Hi @kalyani23  you need update read acl at table level, below is the example

https://www.servicenow.com/community/developer-forum/how-restrict-particular-ritm-records-using-acl/...

Regards
Harish

siva krishna M2
Tera Guru

Hello @kalyani23 ,

 

Apart from Acl's you can achieve this by creating before query business rule on the table with condition as state is draft and with below script.

 

current.addQuery('field name of requestor',gs.getUserID())

 

If it helps kindly click on like icon and mark it as accepted solution.

 

Cons of ACLS: it will give count of restricted records to other requestors with below message on table

Number of rows restricted by security constraints

Hi ,

I have tried using before br query . it is not restricting draft records to users.

 

Hello @kalyani23 

 

Please share the screenshots and code to assist further