How to restrict records to users based on roles and state
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 11:20 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 11:24 PM
Hi @kalyani23 ,
You can create a Read ACL on the relevant table n under that put condition as state is draft & under script section use below script
if(gs.getUserID() == current.requested_by){ // plz modify requested by field name as per ur need but make sure its reference
answer = true;
}
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 11:27 PM
Hello @kalyani23 ,
Kindly check all the read acl's on the table and add below script to all the acl's then it will work
var b = current.requested_for // if requested_for is the field value of requestor
var k = current.state;
if(k=="draft choice value" && gs.getUserID()==b)
{
answer=true;
}
If it helps, Kindy click on like icon and mark it as accepted solution

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 11:27 PM
Hi @kalyani23 first you need to review OOB Read ACL;s which is giving access and then update it accordingly
with condition
state is draft
script:
if(current.fieldName == gs.getUserID())
answer = true;
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 11:33 PM
Hi Harish,
do i need to change it in oob read acl or create new read acl .
thanks.