mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Rename 't' to 'r' in '_r' actor format, refs #1855
This commit is contained in:
parent
c5d30b58a1
commit
3e6a208ba3
2 changed files with 4 additions and 4 deletions
|
|
@ -202,7 +202,7 @@ def permission_allowed_actor_restrictions(actor, action, resource):
|
||||||
# Or the current table? That's any time the resource is (database, table)
|
# Or the current table? That's any time the resource is (database, table)
|
||||||
if resource is not None and not isinstance(resource, str) and len(resource) == 2:
|
if resource is not None and not isinstance(resource, str) and len(resource) == 2:
|
||||||
database, table = resource
|
database, table = resource
|
||||||
table_allowed = _r.get("t", {}).get(database, {}).get(table)
|
table_allowed = _r.get("r", {}).get(database, {}).get(table)
|
||||||
# TODO: What should this do for canned queries?
|
# TODO: What should this do for canned queries?
|
||||||
if table_allowed is not None:
|
if table_allowed is not None:
|
||||||
assert isinstance(table_allowed, list)
|
assert isinstance(table_allowed, list)
|
||||||
|
|
|
||||||
|
|
@ -592,16 +592,16 @@ DEF = "USE_DEFAULT"
|
||||||
DEF,
|
DEF,
|
||||||
),
|
),
|
||||||
({"id": "t", "_r": {"d": {"one": ["es"]}}}, "execute-sql", "one", None, DEF),
|
({"id": "t", "_r": {"d": {"one": ["es"]}}}, "execute-sql", "one", None, DEF),
|
||||||
# Works at the "t" for table level:
|
# Works at the "r" for table level:
|
||||||
(
|
(
|
||||||
{"id": "t", "_r": {"t": {"one": {"t1": ["vt"]}}}},
|
{"id": "t", "_r": {"r": {"one": {"t1": ["vt"]}}}},
|
||||||
"view-table",
|
"view-table",
|
||||||
"one",
|
"one",
|
||||||
"t1",
|
"t1",
|
||||||
DEF,
|
DEF,
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
{"id": "t", "_r": {"t": {"one": {"t1": ["vt"]}}}},
|
{"id": "t", "_r": {"r": {"one": {"t1": ["vt"]}}}},
|
||||||
"view-table",
|
"view-table",
|
||||||
"one",
|
"one",
|
||||||
"t2",
|
"t2",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue