bugfix
This commit is contained in:
parent
8d5af5cad2
commit
71e17ad494
@ -10,25 +10,18 @@ async def delete_anonymous_perm(sor, permid):
|
||||
'permid': permid
|
||||
})
|
||||
|
||||
async def add_roleperm(sor, roleid, path, permid=None):
|
||||
if permid is None:
|
||||
perms = await sor.R('permission', {'path': path})
|
||||
if perms:
|
||||
permid = perms[0].id
|
||||
async def add_roleperm(sor, roleid, permid):
|
||||
ns = {
|
||||
'roleid': roleid,
|
||||
'permid': permid
|
||||
}
|
||||
recs = await sor.R('rolepermission', ns)
|
||||
recs = await sor.R('rolepermission', ns.copy())
|
||||
if recs:
|
||||
print(f'{role}, {path} 已经存在')
|
||||
print(f'{role}, {permid} 已经存在')
|
||||
return
|
||||
await sor.C('rolepermission', {
|
||||
'id': getID(),
|
||||
'roleid': 'anonymous',
|
||||
'perid': p.id
|
||||
})
|
||||
print(f'{role}, {path} perm add')
|
||||
ns['id'] = getID()
|
||||
await sor.C('rolepermission', ns)
|
||||
print(f'{role}, {permid} perm add')
|
||||
return
|
||||
|
||||
async def main():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user