bugfix
This commit is contained in:
parent
768e97f50e
commit
814d11a822
@ -39,6 +39,13 @@ async def main():
|
|||||||
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})
|
||||||
else:
|
else:
|
||||||
perms = await sor.R('permission', {'path': path})
|
perms = await sor.R('permission', {'path': path})
|
||||||
|
if len(perms) < 1:
|
||||||
|
perms = [ DictObject(**{
|
||||||
|
'id': getID(),
|
||||||
|
'path': path
|
||||||
|
}) ]
|
||||||
|
await sor.C('permission', perms[0].copy())
|
||||||
|
|
||||||
if role in ['anonymous', 'logined']:
|
if role in ['anonymous', 'logined']:
|
||||||
for p in perms:
|
for p in perms:
|
||||||
await add_roleperm(sor, role, p.id)
|
await add_roleperm(sor, role, p.id)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user