Skip to content

docs: add example of checking a registered action permission#2659

Open
RamiNoodle733 wants to merge 1 commit intosimonw:mainfrom
RamiNoodle733:fix/issue-2469
Open

docs: add example of checking a registered action permission#2659
RamiNoodle733 wants to merge 1 commit intosimonw:mainfrom
RamiNoodle733:fix/issue-2469

Conversation

@RamiNoodle733
Copy link
Copy Markdown

@RamiNoodle733 RamiNoodle733 commented Mar 8, 2026

Summary

Adds a concrete example showing how to check an action registered with register_actions() using datasette.allowed() and a resource instance.

Changes

  • Added a new Checking a registered action subsection to docs/plugin_hooks.rst
  • Included a short async example that checks "view-document" against DocumentResource(collection, document_id)

Testing

  • uv run blacken-docs -l 60 docs/plugin_hooks.rst
  • uv run cog --check docs/plugin_hooks.rst
  • uv run pytest tests/test_docs.py -q

Fixes #2469


📚 Documentation preview 📚: https://datasette--2659.org.readthedocs.build/en/2659/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an example of using a registered permission to the docs here

1 participant