mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
- Added source_plugin column to all permission SQL queries (required by new system) - Removed unused InstanceResource import from default_menu_links.py - Fixed SQL format to match (parent, child, allow, reason, source_plugin) schema
41 lines
1.3 KiB
Python
41 lines
1.3 KiB
Python
from datasette import hookimpl
|
|
|
|
|
|
@hookimpl
|
|
def menu_links(datasette, actor):
|
|
async def inner():
|
|
if not await datasette.allowed(action="debug-menu", actor=actor):
|
|
return []
|
|
|
|
return [
|
|
{"href": datasette.urls.path("/-/databases"), "label": "Databases"},
|
|
{
|
|
"href": datasette.urls.path("/-/plugins"),
|
|
"label": "Installed plugins",
|
|
},
|
|
{
|
|
"href": datasette.urls.path("/-/versions"),
|
|
"label": "Version info",
|
|
},
|
|
{
|
|
"href": datasette.urls.path("/-/settings"),
|
|
"label": "Settings",
|
|
},
|
|
{
|
|
"href": datasette.urls.path("/-/permissions"),
|
|
"label": "Debug permissions",
|
|
},
|
|
{
|
|
"href": datasette.urls.path("/-/messages"),
|
|
"label": "Debug messages",
|
|
},
|
|
{
|
|
"href": datasette.urls.path("/-/allow-debug"),
|
|
"label": "Debug allow rules",
|
|
},
|
|
{"href": datasette.urls.path("/-/threads"), "label": "Debug threads"},
|
|
{"href": datasette.urls.path("/-/actor"), "label": "Debug actor"},
|
|
{"href": datasette.urls.path("/-/patterns"), "label": "Pattern portfolio"},
|
|
]
|
|
|
|
return inner
|