Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
simonw opened this issue Feb 20, 2025 · 2 comments
Open

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

simonw opened this issue Feb 20, 2025 · 2 comments

Comments

@simonw
Copy link
Owner

simonw commented Feb 20, 2025

https://docs.datasette.io/en/latest/plugin_hooks.html#register-permissions-datasette

This would benefit from an example of how to then check that registered permission.

@simonw
Copy link
Owner Author

simonw commented Feb 20, 2025

https://docs.datasette.io/en/latest/internals.html#await-permission-allowed-actor-action-resource-none-default needs example code too:

Image

And that should link to the register_permissions() docs and vice-versa.

@simonw
Copy link
Owner Author

simonw commented Feb 20, 2025

I'd really like to fix that wart where resource= can be either a single string or a tuple of two strings though - that always catches me out.

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

No branches or pull requests

1 participant