Hrishikesh Barman
04/26/2025, 10:59 AMDennis (Cerbos)
Hrishikesh Barman
04/26/2025, 11:02 AMIf I request a single resource, of course this can work if I ask a second API on whether the request is allowed or not. But if I query a database for a list of items, to add access control I need to modify the database query. I can't just filter after the fact, it's too easy to cause pathological performance issues there e.g. if the user has only access to a very small subset of a large list of results. How does this work with a separate access control API that can't directly modify the database query?https://news.ycombinator.com/item?id=30362395 (okay I understood the database usecase now) but I want to understand if this really is my usecase(having to filter at db query layer), what are my options now?
Hrishikesh Barman
04/26/2025, 11:03 AMDennis (Cerbos)
{
"expression": {
"operator": "eq",
"operands": [
{
"variable": "request.resource.attr.status"
},
{
"value": "PENDING_APPROVAL"
}
]
}
}
It’s straightforward to translate this particular AST to SQL.
Unless you’re using an ORM for which we have an adapter, you must write a translation layer yourself.Dennis (Cerbos)
Hrishikesh Barman
04/26/2025, 11:14 AMDennis (Cerbos)
I’ll try to write the translation layer, if it seems coherent enough would try to submit as an adapter for that.Thank you!