datasette/tests
Simon Willison 30e2f9064b Remove implies_can_view logic from actor restrictions
Simplified restrictions_allow_action() to work on exact-match basis only.
Actor restrictions no longer use permission implication logic - if an actor
has view-table permission, they can view tables but NOT automatically
view-instance or view-database.

Updated test_restrictions_allow_action test cases to reflect new behavior:
- Removed test cases expecting view-table to imply view-instance
- Removed test cases expecting view-database to imply view-instance
- Removed test cases expecting execute-sql to imply view-instance/view-database
- Added test cases verifying exact matches work correctly
- Added test case verifying abbreviations work (es -> execute-sql)

This aligns actor restrictions with the new permission model where each
action is checked independently without hierarchical implications.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 15:38:07 -07:00
..
plugins Update test infrastructure to use register_actions hook 2025-10-25 15:38:07 -07:00
test_templates Fix handling of nested custom page wildcard paths, closes #996 2020-10-07 15:51:11 -07:00
__init__.py Broke up test_app into test_api and test_html 2017-12-15 04:08:24 -08:00
build_small_spatialite_db.py New run_sanity_checks mechanism, for SpatiLite 2019-05-11 15:55:30 -07:00
conftest.py Update test infrastructure to use register_actions hook 2025-10-25 15:38:07 -07:00
ext.c Add new entrypoint option to --load-extensions. (#1789) 2022-08-23 11:34:30 -07:00
fixtures.py Update test infrastructure to use register_actions hook 2025-10-25 15:38:07 -07:00
spatialite.db New run_sanity_checks mechanism, for SpatiLite 2019-05-11 15:55:30 -07:00
test-datasette-load-plugins.sh fix (typo): Corrected spelling of 'environments' (#2268) 2024-02-19 14:41:32 -08:00
test_actions_sql.py Fix schema mismatch in empty result query 2025-10-24 10:32:18 -07:00
test_api.py Hide FTS tables that have content= 2025-04-16 21:44:09 -07:00
test_api_write.py Fixed some more tests 2025-10-24 10:32:18 -07:00
test_auth.py Update tests to use new allowed() method instead of permission_allowed() 2025-10-25 15:38:07 -07:00
test_base_view.py New View base class (#2080) 2023-05-25 17:18:43 -07:00
test_black.py Remove legacy event_loop fixture usage 2025-10-01 12:51:23 -07:00
test_canned_queries.py Correct syntax for link headers, closes #2470 2025-03-09 20:05:43 -05:00
test_cli.py Error on startup if invalid setting types 2025-10-24 10:32:18 -07:00
test_cli_serve_get.py Introduce new /$DB/-/query endpoint, soft replaces /$DB?sql=... (#2363) 2024-07-15 10:33:51 -07:00
test_cli_serve_server.py Move HTTPS test to a bash script 2022-12-17 18:33:07 -08:00
test_config_dir.py Error on startup if invalid setting types 2025-10-24 10:32:18 -07:00
test_config_permission_rules.py New allowed_resources_sql plugin hook and debug tools (#2505) 2025-10-08 14:27:51 -07:00
test_crossdb.py Remove obsolete mix_stderr=False 2025-09-30 14:33:24 -07:00
test_csv.py simple_primary_key now uses integer id, helps close #2458 2025-02-01 21:44:53 -08:00
test_custom_pages.py Remove hashed URL mode 2022-03-18 17:12:03 -07:00
test_datasette_https_server.sh Detect server start/stop more reliably. 2022-12-18 08:01:51 -08:00
test_docs.py Upgrade to latest Black, closes #2239 2024-01-30 19:55:26 -08:00
test_docs_plugins.py Docs on temporary plugins in fixtures, closes #2234 2024-01-12 14:12:14 -08:00
test_facets.py Consider just 1000 rows for suggest facet, closes #2406 2024-08-21 13:36:42 -07:00
test_filters.py ?column_notcontains= table filter, closes #2287 2024-02-27 16:07:41 -08:00
test_html.py Fix test_navigation_menu_links by enabling root_enabled for root actor 2025-10-24 10:32:18 -07:00
test_internal_db.py catalog_views table, closes #2495 2025-07-15 10:22:56 -07:00
test_internals_database.py Hide FTS tables that have content= 2025-04-16 21:44:09 -07:00
test_internals_datasette.py Support nested JSON in metadata.json, closes #2403 2024-08-21 09:53:52 -07:00
test_internals_datasette_client.py A bunch of remaining ds_client conversions, refs #1959 2022-12-17 13:47:55 -08:00
test_internals_request.py Request.fake(... url_vars), plus .fake() is now documented 2022-03-31 19:01:58 -07:00
test_internals_response.py response.set_cookie(), closes #795 2020-06-09 15:19:37 -07:00
test_internals_urls.py Remove hashed URL mode 2022-03-18 17:12:03 -07:00
test_label_column_for_table.py Detect single unique text column in label_column_for_table, closes #2458 2025-02-01 17:02:49 -08:00
test_load_extensions.py Introduce new /$DB/-/query endpoint, soft replaces /$DB?sql=... (#2363) 2024-07-15 10:33:51 -07:00
test_messages.py Introduce new /$DB/-/query endpoint, soft replaces /$DB?sql=... (#2363) 2024-07-15 10:33:51 -07:00
test_package.py Upgrade Docker images to Python 3.11, closes #1853 2022-10-25 12:04:53 -07:00
test_permission_endpoints.py Implement also_requires to enforce view-database for execute-sql 2025-10-24 12:14:52 -07:00
test_permissions.py Remove implies_can_view logic from actor restrictions 2025-10-25 15:38:07 -07:00
test_plugins.py Rename register_permissions tests to register_actions 2025-10-25 15:38:07 -07:00
test_publish_cloudrun.py Use service-specific image ID for Cloud Run deploys, refs #2036 2023-03-08 12:25:55 -08:00
test_publish_heroku.py Upgrade to Python 3.11 on Heroku, refs #1905 2022-11-18 16:44:46 -08:00
test_routes.py Introduce new /$DB/-/query endpoint, soft replaces /$DB?sql=... (#2363) 2024-07-15 10:33:51 -07:00
test_spatialite.py Skip SpatiaLite test if no conn.enable_load_extension() 2022-09-05 17:09:57 -07:00
test_special.py Update tests to use new allowed() method instead of permission_allowed() 2025-10-25 15:38:07 -07:00
test_table_api.py simple_primary_key now uses integer id, helps close #2458 2025-02-01 21:44:53 -08:00
test_table_html.py fix: tilde encode database name in expanded foreign key links (#2476) 2025-04-16 22:15:11 -07:00
test_tables_endpoint.py Use allowed_resources_sql() with CTE for table filtering 2025-10-24 10:32:18 -07:00
test_tracer.py Tracer now catches errors, closes #2405 2024-08-21 12:19:18 -07:00
test_utils.py Fix bug where -s could reset settings to defaults, closes #2389 2024-08-14 14:28:48 -07:00
test_utils_check_callable.py Rename callable.py to check_callable.py, refs #2078 2023-05-25 11:49:40 -07:00
test_utils_permissions.py Implement also_requires to enforce view-database for execute-sql 2025-10-24 12:14:52 -07:00
utils.py Test improvements and fixed deprecation warnings (#2464) 2025-02-04 14:49:52 -08:00
vec.db Update tests to use new allowed() method instead of permission_allowed() 2025-10-25 15:38:07 -07:00