Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
 
Answered
Access to online_user object in SSO extension

In an SSO extension (using the Q2SSORequestHandler), the online_user points to the SSOUser class, instead of the OnlineUser class.
https://docs.q2developer.com/guides/ssos/parameter_bit_flag.html

My question is how I could access to the OnlineUser class in the Q2SSORequestHandler, because I need to get access to property like "is_commercial", which is only available to OnlineUser class. Thanks.

Posted one year ago
Votes Newest

Answers


This is a good callout. It's kinda hard to get at this information, since we only have a user_id and login_name from the SSO handler perspective. But we can make it work with a few calls:

    async def get_is_commercial(self) -> bool:
        customer = await self.db.customer.get(login_name=self.online_user.login_name)
        group = await self.db.group.get_by_id(customer[0].GroupID)
        return group.IsCommercial

Posted one year ago
Brian Mego
227 × 1 Administrator
0

Hi Brian,
Thanks for the response. But when I test it with a commercial user, it returns "False" for the value.
When I use IsUserCommercial.execute, it returns 'Data': {'UserCommercial': {'IsUserCommercial': {'IsCommercial': 'false'}}}
When I use the Group as suggested, it returns Group Info: <Table><GroupID>2</GroupID><GroupDesc>Commercial Users</GroupDesc><DashboardProfileID>1</DashboardProfileID><SecAlertProfileID>1</SecAlertProfileID><IsCommercial>false</IsCommercial><IsTreasury>false</IsTreasury></Table>.
The IsCommercial is false even the GroupDesc is Commercial Users

— Eric Yan   one year ago
131 Views
1 Answer
one year ago
one year ago