This commit is contained in:
yumoqing 2026-03-21 11:33:51 +08:00
parent 2e308c3da2
commit e8f966bdbf
2 changed files with 1133 additions and 1604 deletions

File diff suppressed because it is too large Load Diff

View File

@ -47,27 +47,24 @@ async def main():
}) ]
await sor.C('permission', perms[0].copy())
if role in ['anonymous', 'logined']:
if role in ['anonymous', 'any', 'logined']:
for p in perms:
await add_roleperm(sor, role, p.id)
return
if role in ['anonymous', 'any', 'logined']:
await add_roleperm(sor, role, p.id)
orgtypeid, name = role.split('.')
ns = {
'orgtypeid': orgtypeid,
'name': name
}
roles = await sor.R('role', ns.copy())
if not roles:
ns['id'] = getID()
await sor.C('role', ns.copy())
else:
orgtypeid, name = role.split('.')
ns = {
'orgtypeid': orgtypeid,
'name': name
}
roles = await sor.R('role', ns.copy())
if not roles:
ns['id'] = getID()
await sor.C('role', ns.copy())
else:
ns['id'] = roles[0].id
for p in perms:
await add_roleperm(sor, ns['id'], p.id)
await delete_anonymous_perm(sor, p.id)
ns['id'] = roles[0].id
for p in perms:
await add_roleperm(sor, ns['id'], p.id)
await delete_anonymous_perm(sor, p.id)
if __name__ == '__main__':