4 ms·
You could do that, but you don't need to. The ACL constraint can be any arbitrary SQLish expression that is a boolean. In this case, say select is allowed if:
by tango12 10y ago
You could do that, but you don't need to.
The ACL constraint can be any arbitrary SQLish expression that is a boolean.
In this case, say select is allowed if: req_user_id is in article.viewers.user_id. This means, if the request's user_id is in the viewers list of the article.
It depends on the fact, that you have a relationship called viewers which comes from a table that contains article_id, user_id.
The idea is to allow any ACL rule that can be represented as a constraint in your data model.