This commit is contained in:
yumoqing 2026-03-20 15:45:55 +08:00
parent 3d3bdf8611
commit d848218629

View File

@ -32,15 +32,15 @@ async def add_roleperm(sor, roleid, path, permid=None):
return
async def main():
config = getConfig('.')
db = DBPools(config.databases)
config = getConfig('.')
db = DBPools(config.databases)
if len(sys.argv) < 3:
print(f'{sys.argv[0]} role path')
sys.exit(1)
role = sys.argv[1]
path = sys.argv[2]
async with db.sqlorContext('sage') as sor:
async with db.sqlorContext('sage') as sor:
perms = None
if '%' in path:
perms = await sor.sqlExe('select * from permission where path like ${path}$", {'path': path})
@ -69,5 +69,5 @@ async def main():
if __name__ == '__main__':
asyncio.get_event_loop().run_until_complete(main())
asyncio.get_event_loop().run_until_complete(main())