-
-
Notifications
You must be signed in to change notification settings - Fork 693
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
Way to enable a default=False permission for anonymous users #825
Comments
Idea: the anonymous actor could be passed to {"anonymous": true} Then allow blocks like this could be used to allow them: {
"plugins": {
"datasette-upload-csvs": {
"allow": {
"anonymous": true
}
}
}
} |
I'm torn between if actor.get("anonymous"):
# ... I'm going with |
Alternative design: leave actor alone. Instead specify that allow blocks can look like this: {
"allow": {
"unauthenticated": true
}
} I like this: the above block is very self-documenting. The I'm going with this design. |
When I implement this I should also document default allow vs default deny as a concept, and specify that default next to every documented permission. |
Documented at the bottom of this section: https://github.com/simonw/datasette/blob/7633b9ab249b2dce5ee0b4fcf9542c13a1703ef0/docs/authentication.rst#defining-permissions-with-allow-blocks |
I'd like plugins to be able to ship with a default that says "anonymous users cannot do this", but allow site administrators to over-ride that such that anonymous users can use the feature after all.
This is tricky because right now the anonymous user doesn't have an actor dictionary at all, so there's no key to match to an allow block.
The text was updated successfully, but these errors were encountered: