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

Use Forbidden exception, not custom 403 #1

Closed
simonw opened this issue Jul 6, 2020 · 0 comments
Closed

Use Forbidden exception, not custom 403 #1

simonw opened this issue Jul 6, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Jul 6, 2020

Should raise datasette.utils.asgi.Forbidden, not return a custom 403

async def write(request, datasette):
if not await datasette.permission_allowed(
request.actor, "datasette-write", default=False
):
return Response.html("Permission denied for datasette-write", status=403)

This will make it work with simonw/datasette#812

@simonw simonw added the enhancement New feature or request label Jul 6, 2020
@simonw simonw closed this as completed in 3d3e471 Feb 27, 2024
simonw added a commit that referenced this issue Feb 27, 2024
Refs #1, #6, #7, #8, #9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant