pipeline-sdlc/wwwroot/api/check_perm.dspy
2026-08-12 12:07:41 +08:00

12 lines
395 B
Plaintext

# check_perm.dspy
dbname = get_module_dbname('rbac')
async with DBPools().sqlorContext(dbname) as sor:
recs = await sor.sqlExe("SELECT * FROM rolepermission WHERE roleid='any' LIMIT 3", {})
result = []
for r in (recs or []):
d = r.to_dict() if hasattr(r, 'to_dict') else {}
result.append(d)
return json.dumps({"any_perms": result}, ensure_ascii=False, default=str)