Compare commits
No commits in common. "d8482186297e6e6b2f8014725ece64a008825258" and "4bebb9c3ee69756b73607073b1cf1713f8974e13" have entirely different histories.
d848218629
...
4bebb9c3ee
@ -1591,11 +1591,11 @@ paths="""/favicon.ico
|
||||
/unipay/refund.ui
|
||||
"""
|
||||
async def main():
|
||||
config = getConfig('.')
|
||||
db = DBPools(config.databases)
|
||||
ids = d.split('\n')
|
||||
config = getConfig('.')
|
||||
db = DBPools(config.databases)
|
||||
ids = d.split('\n')
|
||||
cnt = 0
|
||||
async with db.sqlorContext('sage') as sor:
|
||||
async with db.sqlorContext('sage') as sor:
|
||||
for p in paths.split('\n'):
|
||||
if not p:
|
||||
continue
|
||||
|
||||
@ -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())
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user