allow_sql block to control execute-sql upermission in metadata.json, closes #813

Also removed the --config allow_sql:0 mechanism in favour of the new allow_sql block.
This commit is contained in:
Simon Willison 2020-06-08 17:05:44 -07:00
commit 49d6d2f7b0
16 changed files with 92 additions and 44 deletions

View file

@ -10,7 +10,6 @@ from datasette import hookimpl
@hookimpl
def extra_template_vars():
print("this is template vars")
return {
"from_plugin": "hooray"
}
@ -18,7 +17,6 @@ def extra_template_vars():
METADATA = {"title": "This is from metadata"}
CONFIG = {
"default_cache_ttl": 60,
"allow_sql": False,
}
CSS = """
body { margin-top: 3em}
@ -91,7 +89,6 @@ def test_config(config_dir_client):
response = config_dir_client.get("/-/config.json")
assert 200 == response.status
assert 60 == response.json["default_cache_ttl"]
assert not response.json["allow_sql"]
def test_plugins(config_dir_client):