Hi!
Assume you build a social network. Users shall be able to decide who can view what data in their profile, e.g. email, phone number, birthday.
For each of the fields they shall be able to decide if the data shall be visible to anyone, friends only, specific users, or nobody.
What would be the best way to set this up when using FlutterFlow? As per the firebase docs (https://firebase.google.com/docs/firestore/security/rules-fields) best practice would be to create a separate document for each scenario as making rule-based decision in the client on which data to show and which not is presumably unsafe. This leads to multiple issues:
1) For each field I'd need a separate collection (like for phone number "phone_for_public", "phone_for_friends") which means a lot of collections and a lot of update operations for each data change
2) even more difficult: for each user I have to query a different collection, e.g. to get a list of phone numbers of all users I'd have to query the "phone_for_friends" and the "phone_for_public" collection and merge the results. To display phone number for a single user I'd have to also first check which collection to query and the query functionality of FlutterFlow doesn't really support such conditionality. All in all it sounds like a lot of work, I'm not even really sure how I woud do that and I guess I'd probably lose a lot of the autoreload functionality. At first glance building custom cloud functions HTTP APIs seems like a viable option, but then autoreaload is gone as well.
Is there an option I overlook?
Have you encountered similar situations? If yes, how did you solve that problem?
Kind regards,
Max