Skip to content

Commit

Permalink
Missing file, refs #4
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Apr 26, 2024
1 parent 45789d0 commit 121136d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions datasette_test/plugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from datasette import hookimpl


@hookimpl
def permission_allowed(datasette, actor, action):
from datasette.utils import actor_matches_allow

if not hasattr(datasette, "_special_test_permissions"):
return None
special_permissions = datasette._special_test_permissions
if action not in special_permissions:
return None
rule = special_permissions[action]
return actor_matches_allow(actor, rule)

0 comments on commit 121136d

Please sign in to comment.