Query Business Rule to restrict visibility on hardware asset table based on login user location

fareedashaik
Tera Contributor

Hi, 

Could you please guide here, i wanted to restrict the visibility on hardware asset table based on user login location. user can only see their location assets. for this i have written before business query but not impacted.

fareedashaik_0-1693208771482.png

 

Could guide here pls.

 

2 REPLIES 2

SwarnadeepNandy
Mega Sage

Hello @fareedashaik,

Checking based on a very specific location may not fetch you any result.

You may like to match the region or city or country of the user and your Hardware Asset location. NOT the exact location. That may not match exactly.

This is based on my assumption on how you have configured your location table. Assuming that you have store very granular location.

 

Kind Regards,

Swarnadeep Nandy

Sandeep Rajput
Tera Patron
Tera Patron

@fareedashaik Update your code as follows.

 

if(gs.isInteractive()){
current.addQuery("location",gs.getUser().getLocation());
} 

Hope this helps.