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

Refactor permission check for canned query #810

Closed
simonw opened this issue Jun 7, 2020 · 1 comment
Closed

Refactor permission check for canned query #810

simonw opened this issue Jun 7, 2020 · 1 comment

Comments

@simonw
Copy link
Owner

simonw commented Jun 7, 2020

This code here (TODO is follow-on from #808).

# Respect canned query permissions
if canned_query:
await self.check_permission(
request, "view-query", "query", (database, canned_query)
)
# TODO: fix this to use that permission check
if not actor_matches_allow(
request.scope.get("actor", None), metadata.get("allow")
):
return Response("Permission denied", status=403)

I can improve this with extra code in https://github.com/simonw/datasette/blob/86dec9e8fffd6c4efec928ae9b5713748dec7e74/datasette/default_permissions.py

@simonw
Copy link
Owner Author

simonw commented Jun 7, 2020

This is obsoleted by #811.

@simonw simonw closed this as completed Jun 7, 2020
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