Support anonymous: true in actor_matches_allow, refs #825

pull/809/head
Simon Willison 2020-06-09 07:01:23 -07:00
rodzic eb3ec279be
commit fec750435d
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -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):