- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2018 07:24 PM
Hello,
How do i get the current domain of current user using scripts in ACL? after i get the current domain, the users of sys_user table should be restricted, ie, the users whose domain is same as the current domain should only have the access.
How can i implement it using scripts in ACL? Can someone help me with this, with some example?
Regards,
Reeba
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2018 12:08 AM
Can you try like,
Click on the search field in script and the select show related field and then expand the list and select Domain => Domain field and then again expand the list and select sys_id, like
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2018 08:04 PM
Hi Reeb,
Below code will give you sys_id of the domain record
gs.getUser().getDomainID();
Regards
Dhruv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2018 11:07 PM
Hi Dhruv,
Thankyou for your reply. Can we use GlideRecord in ACL scripts?
Regards,
Reeba
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2018 11:13 PM
yes we can.
Regards
Dhruv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2018 11:34 PM
Hello Dhruv,
I have written this code:
var domaine = gs.getUser().getDomainID();
var gruser = new GlideRecord('sys_user');
gruser.addQuery('sys_domain',domaine);
gruser.query();
while(gruser.next())
{
answer = gruser.getDisplayName();
//return(answer);
}
But the it is showing all records match this condition. Can you suggest any changes so that the users are restricted. I have attached the screenshot.
Regards,
Reeba
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2018 12:27 AM
You cannot apply filter to results of a field using ACL(I just read the post of you requirement right-now, a bit late). It needs to be done some other way.
Regards
Dhruv