mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
execute-sql now implies can view instance/database, closes #2169
This commit is contained in:
parent
9cead33fb9
commit
98ffad9aed
2 changed files with 5 additions and 0 deletions
|
|
@ -59,6 +59,7 @@ def register_permissions():
|
||||||
takes_database=True,
|
takes_database=True,
|
||||||
takes_resource=False,
|
takes_resource=False,
|
||||||
default=True,
|
default=True,
|
||||||
|
implies_can_view=True,
|
||||||
),
|
),
|
||||||
Permission(
|
Permission(
|
||||||
name="permissions-debug",
|
name="permissions-debug",
|
||||||
|
|
|
||||||
|
|
@ -1183,6 +1183,10 @@ async def test_actor_restrictions(
|
||||||
({"a": ["update-row"]}, "view-instance", None, False),
|
({"a": ["update-row"]}, "view-instance", None, False),
|
||||||
# view-table on a resource implies view-instance
|
# view-table on a resource implies view-instance
|
||||||
({"r": {"db1": {"t1": ["view-table"]}}}, "view-instance", None, True),
|
({"r": {"db1": {"t1": ["view-table"]}}}, "view-instance", None, True),
|
||||||
|
# execute-sql on a database implies view-instance, view-database
|
||||||
|
({"d": {"db1": ["es"]}}, "view-instance", None, True),
|
||||||
|
({"d": {"db1": ["es"]}}, "view-database", "db1", True),
|
||||||
|
({"d": {"db1": ["es"]}}, "view-database", "db2", False),
|
||||||
# update-row on a resource does not imply view-instance
|
# update-row on a resource does not imply view-instance
|
||||||
({"r": {"db1": {"t1": ["update-row"]}}}, "view-instance", None, False),
|
({"r": {"db1": {"t1": ["update-row"]}}}, "view-instance", None, False),
|
||||||
# view-database on a resource implies view-instance
|
# view-database on a resource implies view-instance
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue