Business can create campaign to ranking customer who join the campaign and give point to customer.
So in the app have many campaigns, I want to fix that only campaign owner who can give a point to his customer who join the campaign. Cannot give a point to customer who join other campaign that they didn’t create.
I have property isBusiness to check that users are Customer/Business/Admin, but I don’t know how to specify business by who created the campaign.
As for me you need to create many-to-one relationship “Campains” - “Users”: one user can have many campaigns, but each campaign may belong only to one user.
Then when you create / manage the campaign, make sure that these options are available only for Business users (you already do it using visibility).
You can have several relationships between 2 collections. For example:
you create first customer relationship: Many Users - one Campaign.
you create second relationship for business: One User - Many Campaigns.
Don’t forget to properly name the relationship fields in both collections, so that you can indicate them later.
And then you filter out the campaigns for business based on second relationship. For a logged-in user it will be something like: list of Campaigns, filtered by Logged-in User → BusinessCampaigns.