How would i give access to my web app but only to certain areas. For example i have a calendar module which is in the basic subscription and then i have a video calling feature which is only for premium subscribers.
Im sorry if the answer is straight forward but i cant seem to get my head around it and did not see any similar answers in the forum.
Youāll have to set this from the database. What I do is to create an option set for the user levelsā¦I.e(free, basic, premium) for example.
Link this option set to the user datatype.
Then youād put conditional saying āwhen this userās role is freeāā¦something like this.
What I do is to create an option set for the user levelsā¦I.e(free, basic, premium) for example.
Link this option set to the user datatype.
Then youād put conditional saying āwhen this userās role is freeā
Iād second this, but to plan for future changes / scaling up, you might also want to add a number value to that option set.
For example, letās say I have five tiers: Free, Starter, Growth, Team, and Enterprise There are features that I only want to give to Growth customers and up.
If I just create an option set with the names of the tiers, to create a condition for Growth and up, Iād have to write Current user's Tier is Growth or Current user's Tier is Team or Current user's Tier is Enterprise for each condition. If I want to remove one of those tiers at a later date, Iād need to edit every single condition; if I want to add additional tiers with access to this feature, Iād add that tier to every condition.
If I assign a number field to each entry in that option set, itās easier to make changes. In this example, letās say I assign 2 to the Free tier, 4 to the Starter tier, 6 to Growth, 8 to Team, and 10 to Enterprise. Then, instead of the complex condition as above, I can create a condition for Growth and up to be Current user's Tier's number ā„ 6. This allows me to remove tiers without causing errors, and I can add tiers in between based on conditions Iāve written for other features (e.g. I could create a tier between Growth and Team and assign it a ā7ā without having to rewrite every relevant conditional in my app).
Being able to scale like this is something Iāve found really useful when building apps, so hopefully you will too!
The approach I use is to have an option set (or data type) of plans.
Each plan has a list of permissions (option set) e.g can create X, can see Y. I use Current Userās planās permissions contains (the relevant permission). For numbers e.g can send messages X times, thatās obviously just a number field on the plan.
That gives more flexibility than numbers and more granular permissions per plan (e.g where plans arenāt necessary hierarchal but provide different features all together)