How to restrict list view of records using ACLs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2018 08:51 PM
Hi All,
i am using the below script to restrict users to access a module
var hasPriv = getUserDiocese();
if ((hasPriv == true) && (gs.hasRole('admin') || gs.hasRole('itil'))) {
answer = true;
} else {
answer = false;
}
//This function gets the logged in users diocese
function getUserDiocese() {
var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id', gs.getUserID());
gr.query();
if (gr.next()) {
if (gr.company.getDisplayValue() == 'Parramatta') {
return true;
} else {
return false;
}
}
}
Can you please suggest me on this to restrict list of records on the module level

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2018 08:57 PM
You can create Read ACL to restrict who can see the record. Add the same script to it.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2018 10:30 PM
Hi,
Is it table level or field level.. Does my code require any changes

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2018 10:39 PM
It is table level. Table.None. I dont think code requires change
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2018 08:58 PM
have you tried with query business rule?
kindly refer the thread below.