actor_from_request and permission_allowed hookspecs, refs #699

This commit is contained in:
Simon Willison 2020-05-30 13:24:00 -07:00
commit 060a56735c
2 changed files with 47 additions and 0 deletions

View file

@ -58,3 +58,13 @@ def register_output_renderer(datasette):
@hookspec
def register_facet_classes():
"Register Facet subclasses"
@hookspec
def actor_from_request(datasette, request):
"Return an actor dictionary based on the incoming request"
@hookspec
def permission_allowed(actor, action, resource_type, resource_identifier):
"Check if actor is allowed to perfom this action - return True, False or None"