datasette/datasette/utils
Claude c9429466cd
Remove test-only cascading logic implementation, fix params bug
Three changes:

1. Rewrite test_utils_permissions.py to exercise production code paths
   (allowed_resources / allowed) instead of the test-only
   resolve_permissions_from_catalog function. Tests now register plugins
   via ds.pm.register and call the real Datasette methods.

2. Remove resolve_permissions_from_catalog, resolve_permissions_with_candidates,
   and build_rules_union from datasette/utils/permissions.py. These were
   only used by tests and implemented the cascading logic a third time,
   independently of the two production implementations.

3. Fix bug in gather_permission_sql_from_hooks where empty params dicts
   ({}) would cause framework-injected params (:actor_id, :actor, :action)
   to be silently lost. The expression `params = permission_sql.params or {}`
   creates a new dict when params is {} (falsy), so setdefault writes to a
   throwaway dict. Fixed by explicitly checking `is None`.

https://claude.ai/code/session_013EkyroQKPhcjdMbpHc9g4X
2026-02-06 02:10:36 +00:00
..
__init__.py Workaround for intermittent test failure on SQLite 3.25.3 2026-01-28 18:34:00 -08:00
actions_sql.py datasette.client.get(..., skip_permission_checks=True) 2025-11-05 13:38:01 -08:00
asgi.py Add request.form() for multipart form data and file uploads 2026-01-28 18:41:03 -08:00
baseconv.py Rename to_decimal/from_decimal to decode/encode, refs #1734 2022-05-02 12:44:09 -07:00
check_callable.py Fix for asyncio.iscoroutinefunction deprecation warnings 2025-10-08 20:32:16 -07:00
internal_db.py Better fix for stale catalog_databases, closes #2606 2025-12-02 19:00:13 -08:00
multipart.py Add request.form() for multipart form data and file uploads 2026-01-28 18:41:03 -08:00
permissions.py Remove test-only cascading logic implementation, fix params bug 2026-02-06 02:10:36 +00:00
shutil_backport.py Upgrade to latest Black, closes #2239 2024-01-30 19:55:26 -08:00
sqlite.py Show pysqlite3 version on /-/versions, if installed - #1125 2020-12-03 14:08:50 -08:00
testing.py Fixed bug with ?_trace=1 and large responses, closes #2404 2024-08-21 10:58:17 -07:00