Unanswered
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
15 Views
0
Answers
one year ago
one year ago
Hi Brian,
— Eric Yan one year agoThanks 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