mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
WIP restrictions SQL mechanism, refs #2572
This commit is contained in:
parent
fa978ec100
commit
2fd98f4422
7 changed files with 434 additions and 113 deletions
|
|
@ -1630,6 +1630,16 @@ async def test_hook_register_actions_with_custom_resources():
|
|||
reason="user2 granted view-document-collection"
|
||||
)
|
||||
|
||||
# Default allow for view-document-collection (like other view-* actions)
|
||||
if action == "view-document-collection":
|
||||
return PermissionSQL.allow(
|
||||
reason="default allow for view-document-collection"
|
||||
)
|
||||
|
||||
# Default allow for view-document (like other view-* actions)
|
||||
if action == "view-document":
|
||||
return PermissionSQL.allow(reason="default allow for view-document")
|
||||
|
||||
# Register the plugin temporarily
|
||||
plugin = TestPlugin()
|
||||
pm.register(plugin, name="test_custom_resources_plugin")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue