This commit is contained in:
yumoqing 2026-03-20 18:28:05 +08:00
parent 31f9d796ec
commit 1954aa6fa8

View File

@ -33,7 +33,7 @@ order by c.orgtypeid, c.name"""
from users a, role b, userrole c
where a.id = c.userid
and c.roleid = b.id
and a.id = ${userid}''', {'userid': userid})
and a.id = ${userid}$''', {'userid': userid})
roles = ['*.*'] # 登录用户
for r in recs:
append(f'{r.orgtypeid}.{r.name}')
@ -54,6 +54,7 @@ where a.id = c.userid
if self.rp_caches is None or not roles:
env = ServerEnv()
async with get_sor_context(env, 'rbac') as sor:
if not self.rp_caches:
await self.load_roleperms(sor)
if not roles:
await self.get_userroles(sor, userid)