mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Support anonymous: true in actor_matches_allow, refs #825
This commit is contained in:
parent
eb3ec279be
commit
fec750435d
1 changed files with 2 additions and 2 deletions
|
|
@ -873,12 +873,12 @@ def actor_matches_allow(actor, allow):
|
||||||
for key, values in allow.items():
|
for key, values in allow.items():
|
||||||
if values == "*" and key in actor:
|
if values == "*" and key in actor:
|
||||||
return True
|
return True
|
||||||
if isinstance(values, str):
|
if not isinstance(values, list):
|
||||||
values = [values]
|
values = [values]
|
||||||
actor_values = actor.get(key)
|
actor_values = actor.get(key)
|
||||||
if actor_values is None:
|
if actor_values is None:
|
||||||
return False
|
return False
|
||||||
if isinstance(actor_values, str):
|
if not isinstance(actor_values, list):
|
||||||
actor_values = [actor_values]
|
actor_values = [actor_values]
|
||||||
actor_values = set(actor_values)
|
actor_values = set(actor_values)
|
||||||
if actor_values.intersection(values):
|
if actor_values.intersection(values):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue