mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
unauthenticated: true method plus allow block docs, closes #825
This commit is contained in:
parent
70dd14876e
commit
7633b9ab24
6 changed files with 134 additions and 55 deletions
|
|
@ -867,10 +867,11 @@ async def async_call_with_supported_arguments(fn, **kwargs):
|
|||
|
||||
|
||||
def actor_matches_allow(actor, allow):
|
||||
if actor is None:
|
||||
actor = {"anonymous": True}
|
||||
if actor is None and allow and allow.get("unauthenticated") is True:
|
||||
return True
|
||||
if allow is None:
|
||||
return True
|
||||
actor = actor or {}
|
||||
for key, values in allow.items():
|
||||
if values == "*" and key in actor:
|
||||
return True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue