mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Add PermissionCheck dataclass with parent/child fields, refs #2528
Instead of logging permission checks as dicts with a 'resource' key, use a typed dataclass with separate parent and child fields. Changes: - Created PermissionCheck dataclass in app.py - Updated permission check logging to use dataclass - Updated PermissionsDebugView to use dataclass attributes - Updated PermissionCheckView to check parent/child instead of resource - Updated permissions_debug.html template to display parent/child - Updated test expectations to use dataclass attributes This provides better type safety and cleaner separation between parent and child resource identifiers.
This commit is contained in:
parent
4760cb9e06
commit
10ea23a59c
4 changed files with 37 additions and 34 deletions
|
|
@ -1259,9 +1259,10 @@ async def test_actor_restrictions(
|
|||
"response_status": response.status_code,
|
||||
"checks": [
|
||||
{
|
||||
"action": check["action"],
|
||||
"resource": check["resource"],
|
||||
"result": check["result"],
|
||||
"action": check.action,
|
||||
"parent": check.parent,
|
||||
"child": check.child,
|
||||
"result": check.result,
|
||||
}
|
||||
for check in perms_ds._permission_checks
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue