fastapi-permissions
fastapi-permissions copied to clipboard
Question about list_permissions in `show_items` endpoint
Hi @holgi ,
First, thanks for sharing this package!
When this is the response of show_items endpoint in the example. I login with alice, and I don't understand why view is false for both item 1 and 2. Thanks!
[
{
"items": {
"1": {
"name": "Stilton",
"owner": "bob"
},
"2": {
"name": "Danish Blue",
"owner": "alice"
}
},
"available_permissions": {
"1": {
"use": false,
"view": false
},
"2": {
"use": true,
"view": false
}
}
}
]
Hi @holgi , I think it should be get_active_principals in depends instead of get_current_user.
async def show_items(
ilr: ItemListResource = Permission("view", ItemListResource),
user=Depends(get_current_user),
):