How to restrict other domain tickets from user even if they have multiple domain visibility with respect to domain picker

jobin1
Tera Expert

Hi All

The below user has 2 domain visibility's both Accenture and demo but when he loggedIN if he is in the demo domain then also he can able to see Accenture domain tickets , That should not happen If the loggedIN user is not in that domain then those domain tickets should not be visible.


How we can achieve this?

Note: The user will be part of 2 visibility groups but in domain picker, if he selects one domain then those only should be visible.

 

 

 

 

 

 
1 ACCEPTED SOLUTION

Allen Andreas
Administrator
Administrator

Hello,

Out of box behavior allows the user to see those records because you've given them "visibility" for that domain. To limit this, would mean you would need to enforce custom behavior and with that...you'd want to consider using something like a query business rule or ACL to limit their access.

You'd want to also consider giving those users a specific role and then within the query business rule you could do something like:

if (gs.hasRole('role_name')) {
current.addQuery('sys_domain', gs.getUser().getDomainID());
}

So now it'll filter records for that table to only show same domain records.

The above is an example, please take it from there.

Please mark reply as Helpful/Correct, if applicable. Thanks!

 


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

10 REPLIES 10

jobin1
Tera Expert

@Jaspal Singh  Any idea on this?

jobin1
Tera Expert

@Ankur Bawiskar Any idea?

Allen Andreas
Administrator
Administrator

Hello,

Out of box behavior allows the user to see those records because you've given them "visibility" for that domain. To limit this, would mean you would need to enforce custom behavior and with that...you'd want to consider using something like a query business rule or ACL to limit their access.

You'd want to also consider giving those users a specific role and then within the query business rule you could do something like:

if (gs.hasRole('role_name')) {
current.addQuery('sys_domain', gs.getUser().getDomainID());
}

So now it'll filter records for that table to only show same domain records.

The above is an example, please take it from there.

Please mark reply as Helpful/Correct, if applicable. Thanks!

 


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Also, please don't post duplicate questions...

https://community.servicenow.com/community?id=community_question&sys_id=c6ee023cdb8cd19439445ac2ca96...


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!