I want to add a row permission to a table based on data in another table. Example:
tableA
keyA | approved
----------------
key1 | false
key2 | true
tableB
keyB | value
----------------
key1 | querying this row is not allowed
key2 | this row should be allowed
My feeling is this can be achieved by using "_exists" operator but I seem to be unable to manage it in the permission configuration. I expect something like this:
Row select permission on tableB:
{
"_exists": {
"_table": {
"schema": "my-scheme",
"name": "tableA"
},
"_where": {
"_and":[
{"keyA": {"_ceq": "keyB" }},
{"approved": {"_eq": true }}
]
}
}
}
When I try with "_ceq" operator, Hasura offers only the columns from tableA where I would expect columns from tableB instead. Any ideas on that? Thanks!
I am using Docker hasura/graphql-engine:v1.3.2