Skip to content

Commit

Permalink
Support anonymous: true in actor_matches_allow, refs #825
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Jun 9, 2020
1 parent eb3ec27 commit fec7504
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions datasette/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -873,12 +873,12 @@ def actor_matches_allow(actor, allow):
for key, values in allow.items():
if values == "*" and key in actor:
return True
if isinstance(values, str):
if not isinstance(values, list):
values = [values]
actor_values = actor.get(key)
if actor_values is None:
return False
if isinstance(actor_values, str):
if not isinstance(actor_values, list):
actor_values = [actor_values]
actor_values = set(actor_values)
if actor_values.intersection(values):
Expand Down

0 comments on commit fec7504

Please # to comment.