mirror of
https://github.com/simonw/datasette.git
synced 2026-06-04 16:16:59 +02:00
Restructured the table listing logic in get_tables() to check permissions via SQL first using the permission_resources_sql plugin hook, then only fetch table counts for tables that will actually be displayed. Previous implementation called table_counts() for all tables before checking permissions, which defeated the purpose of the optimization - it still required scanning every table just to list them. Changes: - Modified Database.table_counts() to accept optional 'tables' parameter that allows selective counting while preserving caching for immutable DBs - Rewrote get_tables() in database view to query catalog_tables for table names first (cheap operation), use resolve_permissions_from_catalog to check permissions in bulk, then only call table_counts() with the subset of allowed tables - Fixed bug in default_permissions.py where query_config could be a string instead of dict, causing AttributeError - Correctly handles table-level 'allow: True' blocks that should bypass database-level restrictions when determining privacy status All 177 permission tests passing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| publish | ||
| static | ||
| templates | ||
| utils | ||
| views | ||
| __init__.py | ||
| __main__.py | ||
| actor_auth_cookie.py | ||
| app.py | ||
| blob_renderer.py | ||
| cli.py | ||
| database.py | ||
| default_magic_parameters.py | ||
| default_menu_links.py | ||
| default_permissions.py | ||
| events.py | ||
| facets.py | ||
| filters.py | ||
| forbidden.py | ||
| handle_exception.py | ||
| hookspecs.py | ||
| inspect.py | ||
| permissions.py | ||
| plugins.py | ||
| renderer.py | ||
| sql_functions.py | ||
| tracer.py | ||
| url_builder.py | ||
| version.py | ||