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

@Allen Andreas Thanks for the update .

I tried with Before update Br on sc_req_item table and it worked but when I am in the global domain that time I am not able to see all domain tickets also I tried for removing admins from this setup by below change but not worked.

 

 

@Allen Andreas Thanks, Allen.It's working on PDI, let me do complete testing, will update ASAP

@Allen Andreas Thanks, Allen.It's working on PDI, let me do complete testing, will update ASAP

@Allen Andreas,  This is working. and I have one additional query.

If that user logs in, is there any way to set the domain picker to a default domain?

ie: user having visibility to the ABC domain and XYZ domain and while logging in it should be set to XYZ domain all the time? and later they can change.

Hi,

That is somewhat a separate question from the above.

Please mark my reply above that helped guide you properly, as Correct.

I'll give some assistance here, but if you are still having any issues, please create a new question, but feel free to tag me in it via @Allen Andreas 

This support article from ServiceNow helps explain what you're asking: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0822648

Please mark reply as Helpful, if applicable. Thanks!


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