Hey all, I am trying to create a membership area on my website where not all members have the same access. The goal of it would be that different members have different accesses to different things:
Example:
Member A is a part of “staff”. Therefore they have access to a membership page with staff settings that regular members wouldn’t have.
Member B is a “gold member”. They have access to a “gold page” that members without access cannot.
I understand I’ll be using collections and code for this but I’m not sure how to get started. Let me know. Thanks!
I’m still having trouble with this, by the way.
Hey!
Please check the wix-users API:
https://www.wix.com/code/reference/wix-users.html
In your code, you can use this API to know which user is currently visiting a page in your site with the currentUser property.
You can then use the information of that user, specifically its ID and role, and validate these pieces of information against collections you manage for “staff”/“gold members”. When you know, in your code, whether the current user is part of the relevant collection of members, you can instruct the page to show its content or to display some messages such as “You are not authorized to see this page”.
Hey, thanks for the response. I’m starting to get things together. What you’ve said seems to be working pretty well and was the route that I had started to go down. Thank you! I’ll update this if I have further questions.