Remove stale self.permissions dictionary and get_permission() method

The self.permissions dictionary was declared in __init__ but never
populated - only self.actions gets populated during startup.

The get_permission() method was unused legacy code that tried to look
up permissions from the empty self.permissions dictionary.

Changes:
- Removed self.permissions = {} from Datasette.__init__
- Removed get_permission() method (unused)
- Renamed test_get_permission → test_get_action to match actual method being tested

All tests pass, confirming these were unused artifacts.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Simon Willison 2025-10-25 14:50:10 -07:00
commit e4f549301b
2 changed files with 1 additions and 16 deletions

View file

@ -161,7 +161,7 @@ def test_datasette_error_if_string_not_list(tmpdir):
@pytest.mark.asyncio
async def test_get_permission(ds_client):
async def test_get_action(ds_client):
ds = ds_client.ds
for name_or_abbr in ("vi", "view-instance", "vt", "view-table"):
action = ds.get_action(name_or_abbr)