kopia lustrzana https://github.com/simonw/datasette
Rename 't' to 'r' in '_r' actor format, refs #1855
rodzic
c5d30b58a1
commit
3e6a208ba3
|
@ -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)
|
||||
if resource is not None and not isinstance(resource, str) and len(resource) == 2:
|
||||
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?
|
||||
if table_allowed is not None:
|
||||
assert isinstance(table_allowed, list)
|
||||
|
|
|
@ -592,16 +592,16 @@ DEF = "USE_DEFAULT"
|
|||
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",
|
||||
"one",
|
||||
"t1",
|
||||
DEF,
|
||||
),
|
||||
(
|
||||
{"id": "t", "_r": {"t": {"one": {"t1": ["vt"]}}}},
|
||||
{"id": "t", "_r": {"r": {"one": {"t1": ["vt"]}}}},
|
||||
"view-table",
|
||||
"one",
|
||||
"t2",
|
||||
|
|
Ładowanie…
Reference in New Issue