how do i get the current domain of current user using scripts in ACL?

reeba1
Tera Contributor

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

1 ACCEPTED SOLUTION

Can you try like,

 

find_real_file.png

 

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

 

find_real_file.png  find_real_file.png

find_real_file.png

View solution in original post

13 REPLIES 13

Shishir Srivast
Mega Sage

I think, sys_user table is domain separated so record visibility will be within the same domain users.

 

This part is not much clear: the users whose domain is same as the current domain should only have the access. I mean how can you restrict the Access based upon current user domain to other users?

Hello Shishir,

 

There is a field called "+Add Member" in visual task board. It displays all users of all domains, but we want only the current domain's users to be displayed. The configuration for that field is in a plugin code which is not accessible to us, it queries the sys_user table active =true because of which all users are displayed. So, I was trying whether by using ACL we can restrict it. Do you have any suggestions? 

 

Regards,

Reeba

Can you try like,

 

find_real_file.png

 

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

 

find_real_file.png  find_real_file.png

find_real_file.png

Hello Shishir,

Thankyou, the it is showing the correct number of records. But the in the visual task board, stil showsl all users of all domains . Do you know of any other way we can do it? or should this be done by servicenow employee?