- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2016 05:50 AM
should ACL script return true explicitly to grant access?
will this below ACL return true if any of the condition satisify ?
current.isNewRecord() || current.request.opened_by == gs.getUserID() || current.request.requested_for == gs.getUserID() || gs.hasRole('itil')
Or should this be wrapped inside a function as below?
checkAccess();
function checkAccess() {
if (current.isNewRecord() || current.request.opened_by == gs.getUserID() || current.request.requested_for == gs.getUserID() || gs.hasRole('itil')){
return true;
}
else{
return false;
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2016 06:15 AM
Both will work in same manner.
As per the wiki
The script must generate a true or false response in one of two ways:
- return an answer variable set to a value of true or false
- evaluate to true or false.
So since both of the values return to true. It will work in both conditions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2016 06:15 AM
Both will work in same manner.
As per the wiki
The script must generate a true or false response in one of two ways:
- return an answer variable set to a value of true or false
- evaluate to true or false.
So since both of the values return to true. It will work in both conditions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2016 07:25 AM
As a reference for the Harshavardhan's answer - you can always check any out of box ACL
Please find the the out of box ACL on Incident table -
Hopefully it helps

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2016 07:30 AM
Hi Prasanna,
Answer to your first question is YES. And second method is the best approach.
Thanks
Abhinandan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2016 09:19 AM
why is second method the best?