mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Better example plugin for permission_allowed
Also fixed it so default permission checks run after plugin permission checks, refs #818
This commit is contained in:
parent
8205d58316
commit
e0a4664fba
3 changed files with 41 additions and 5 deletions
|
|
@ -2,7 +2,7 @@ from datasette import hookimpl
|
|||
from datasette.utils import actor_matches_allow
|
||||
|
||||
|
||||
@hookimpl
|
||||
@hookimpl(tryfirst=True)
|
||||
def permission_allowed(datasette, actor, action, resource):
|
||||
if action == "permissions-debug":
|
||||
if actor and actor.get("id") == "root":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue