mirror of
https://github.com/simonw/datasette.git
synced 2026-06-15 13:36:58 +02:00
allowed_resources(view-query, actor) fix
Previously we could not filter for canned queries that a specific actor could view.
This commit is contained in:
parent
fd016f7986
commit
e800312b54
5 changed files with 75 additions and 9 deletions
|
|
@ -1672,7 +1672,7 @@ async def test_hook_register_actions_with_custom_resources():
|
|||
super().__init__(parent=collection, child=None)
|
||||
|
||||
@classmethod
|
||||
async def resources_sql(cls, datasette) -> str:
|
||||
async def resources_sql(cls, datasette, actor=None) -> str:
|
||||
return """
|
||||
SELECT 'collection1' AS parent, NULL AS child
|
||||
UNION ALL
|
||||
|
|
@ -1689,7 +1689,7 @@ async def test_hook_register_actions_with_custom_resources():
|
|||
super().__init__(parent=collection, child=document)
|
||||
|
||||
@classmethod
|
||||
async def resources_sql(cls, datasette) -> str:
|
||||
async def resources_sql(cls, datasette, actor=None) -> str:
|
||||
return """
|
||||
SELECT 'collection1' AS parent, 'doc1' AS child
|
||||
UNION ALL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue