Hi all! I’m looking for thoughts on setting up data structure and privacy rules for a B2B app that’s similar to Asana or Slack in that a User might be a “member” of several different accounts (in this case, organizations) which all have discrete sets of data.
Essentially, I’m looking for this type of setup:
- An individual user can log in with her email address and then click on her profile picture in the header bar to switch between her own “account” and her various clients’ “accounts” to see/work on their data.
- An organization (or the admin on that org account) can invite people to their “account” via email, and those individuals can join that “account,” even if they have own “accounts” or are members of other org “accounts.”
Note: I’m using the word “account” here but I’ve seen people use “teams” here on the forums, so I hope it’s clear that I mean the same thing.
Specifically, I’m trying to understand these things:
- Do I need a separate data type for “Team” or “Account” that people are members/admins of?
- How do I then make sure all members can see anything related to stuff connected to Teams they’re members of? Privacy Rules don’t seem to allow for this level of complexity. Do I need to set up a back-end workflow situation that automatically adds all members to a “members” list field on all the pertinent data types? Seems like this could get messy when new people are added or removed from a team (then again, I’m new to back-end workflows, so maybe this is easy?).
Would be grateful for any specific suggestions, reference articles, other posts, etc., to help me figure this out.
p.s. I’ve outlined my specific use case is in the first comment below, for reference.