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
|
/unipay/refund.ui
|
||||||
"""
|
"""
|
||||||
async def main():
|
async def main():
|
||||||
config = getConfig('.')
|
config = getConfig('.')
|
||||||
db = DBPools(config.databases)
|
db = DBPools(config.databases)
|
||||||
ids = d.split('\n')
|
ids = d.split('\n')
|
||||||
cnt = 0
|
cnt = 0
|
||||||
async with db.sqlorContext('sage') as sor:
|
async with db.sqlorContext('sage') as sor:
|
||||||
for p in paths.split('\n'):
|
for p in paths.split('\n'):
|
||||||
if not p:
|
if not p:
|
||||||
continue
|
continue
|
||||||
|
|||||||
@ -32,15 +32,15 @@ async def add_roleperm(sor, roleid, path, permid=None):
|
|||||||
return
|
return
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
config = getConfig('.')
|
config = getConfig('.')
|
||||||
db = DBPools(config.databases)
|
db = DBPools(config.databases)
|
||||||
if len(sys.argv) < 3:
|
if len(sys.argv) < 3:
|
||||||
print(f'{sys.argv[0]} role path')
|
print(f'{sys.argv[0]} role path')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
role = sys.argv[1]
|
role = sys.argv[1]
|
||||||
path = sys.argv[2]
|
path = sys.argv[2]
|
||||||
async with db.sqlorContext('sage') as sor:
|
async with db.sqlorContext('sage') as sor:
|
||||||
perms = None
|
perms = None
|
||||||
if '%' in path:
|
if '%' in path:
|
||||||
perms = await sor.sqlExe('select * from permission where path like ${path}$", {'path': path})
|
perms = await sor.sqlExe('select * from permission where path like ${path}$", {'path': path})
|
||||||
@ -69,5 +69,5 @@ async def main():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__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