I’m pretty new to Backendless, and I’m investigating ways to provide some support for fine-grained access control, i.e., only return data or allow operations on data related to the “domain” (see below) of the user issuing an API call against my database.
- I have a domain table and an asset table, in addition to the provided user table.
- Each user is connected to a particular domain (1:1).
- Each asset is connected to a particular domain (1:1).
- When issuing a get on assets, I want to return only the assets that are connected to the logged-in user’s domain. Whatever is consuming the api should have no idea that there are other assets connected to other domains.
My initial thought is to build an event handler after find on asset, to only return assets that are connected to the same domain that the logged-in user is connected to. Is this the best approach? If not, suggestions are welcome. If so, could I please have some guidance as to how to write a Codeless filter that checks to see if the asset’s related domain is the same as the user’s related domain?
Thanks so much for any assistance!
John