Implemented datasette.permission_allowed(), refs #699

This commit is contained in:
Simon Willison 2020-05-30 15:24:43 -07:00
commit 9315bacf6f
5 changed files with 75 additions and 4 deletions

View file

@ -134,3 +134,11 @@ def actor_from_request(datasette, request):
return {"id": "bot"}
else:
return None
@hookimpl
def permission_allowed(actor, action):
if action == "this_is_allowed":
return True
elif action == "this_is_denied":
return False