bugfix
This commit is contained in:
parent
5f805201ea
commit
73e4aac4be
13
wwwroot/get_all_roles.dspy
Normal file
13
wwwroot/get_all_roles.dspy
Normal file
@ -0,0 +1,13 @@
|
||||
async with get_sor_context(request._run_ns, 'rbac') as sor:
|
||||
recs = sor.R('role', {})
|
||||
d = []
|
||||
for r in recs:
|
||||
if r.id in ['anonymous', 'any', 'logined']:
|
||||
d.append(r.id)
|
||||
else:
|
||||
d.append(f'{r.orgtypeid}.{r.name}')
|
||||
d.append(f'{r.orgtypeid}.*')
|
||||
d.append(f'*.{r.name}')
|
||||
d = sorted(list(set(d)))
|
||||
return d
|
||||
return []
|
||||
15
wwwroot/get_normal_roles.dspy
Normal file
15
wwwroot/get_normal_roles.dspy
Normal file
@ -0,0 +1,15 @@
|
||||
async with get_sor_context(request._run_ns, 'rbac') as sor:
|
||||
recs = sor.R('role', {})
|
||||
d = []
|
||||
for r in recs:
|
||||
if r.id in ['anonymous', 'any', 'logined']:
|
||||
continue
|
||||
elif r.orgtypeid == '*' or r.orgtypeid is None:
|
||||
continue
|
||||
elif r.name == '*' or r.name is None:
|
||||
continue
|
||||
else:
|
||||
d.append(f'{r.orgtypeid}.{r.name}')
|
||||
d = sorted(list(set(d)))
|
||||
return d
|
||||
return []
|
||||
Loading…
x
Reference in New Issue
Block a user