mirror of
https://github.com/simonw/datasette.git
synced 2026-05-31 22:27:00 +02:00
set-column-types permission, refs #2671
This commit is contained in:
parent
feaba9b18b
commit
bee25f58cb
5 changed files with 64 additions and 2 deletions
|
|
@ -191,6 +191,7 @@ def test_auth_create_token(
|
|||
"all:view-query",
|
||||
"database:fixtures:drop-table",
|
||||
"resource:fixtures:foreign_key_references:insert-row",
|
||||
"resource:fixtures:facetable:set-column-types",
|
||||
}
|
||||
)
|
||||
# Now try actually creating one
|
||||
|
|
@ -427,6 +428,15 @@ async def test_root_with_root_enabled_gets_all_permissions(ds_client):
|
|||
is True
|
||||
)
|
||||
|
||||
assert (
|
||||
await ds_client.ds.allowed(
|
||||
action="set-column-types",
|
||||
resource=TableResource("fixtures", "facetable"),
|
||||
actor=root_actor,
|
||||
)
|
||||
is True
|
||||
)
|
||||
|
||||
assert (
|
||||
await ds_client.ds.allowed(
|
||||
action="drop-table",
|
||||
|
|
@ -491,3 +501,12 @@ async def test_root_without_root_enabled_no_special_permissions(ds_client):
|
|||
)
|
||||
is not True
|
||||
), "Root without root_enabled should not automatically get drop-table"
|
||||
|
||||
assert (
|
||||
await ds_client.ds.allowed(
|
||||
action="set-column-types",
|
||||
resource=TableResource("fixtures", "facetable"),
|
||||
actor=root_actor,
|
||||
)
|
||||
is not True
|
||||
), "Root without root_enabled should not automatically get set-column-types"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue