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-07-2024 01:41 AM
Hi ,
please find screenshot below
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 01:53 AM - edited 02-07-2024 01:57 AM
Hello @kalyani23
Try below code
if(!gs.hasRole('admin'))
{
if(current.request_status=='Draft')
{
current.addQuery('requester_name',gs.getUserID())
}
}
If requester_name is correct field name and if it is reference field then it will work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 02:15 AM
Hi ,
Tried the same code and still not working .
yes the field_name is correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 02:47 AM
Hello @kalyani23
Try below code
if(!gs.hasRole('admin'))
{
if(current.request_status=='draft')
{
current.addQuery('requester_name',gs.getUserID())
}
}
Could you please try above code if it won't work send me the choice value of draft state
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 03:00 AM
Hi, please find screenshots