debug: check login perms

This commit is contained in:
ymq 2026-08-12 12:07:03 +08:00
parent 41f0a585cd
commit 262280a9ed

View File

@ -0,0 +1,14 @@
# check_perm.dspy
dbname = get_module_dbname('rbac')
async with DBPools().sqlorContext(dbname) as sor:
recs = await sor.sqlExe(
"SELECT path, roleid FROM rolepermission WHERE path LIKE '%login%'", {})
perms = [{"path": getattr(r, "path", ""), "roleid": getattr(r, "roleid", "")} for r in (recs or [])]
# Also check up_login
recs2 = await sor.sqlExe(
"SELECT path, roleid FROM rolepermission WHERE path LIKE '%up_login%' OR path LIKE '%login.ui%'", {})
perms2 = [{"path": getattr(r, "path", ""), "roleid": getattr(r, "roleid", "")} for r in (recs2 or [])]
return json.dumps({"login_perms": perms, "up_login_perms": perms2}, ensure_ascii=False)