Privacy between member collections

Hello. When I have different member collections, what is the best way to create privacy between them, when I want to disply them in different pages?

What do you mean by " to create privacy between them"?

I mean devide members by categories so they can’t see each other

Still not very clear :grin:

Sorry, but because of your unclear description of your issue, you didn’t get any answer yet.

Even Velo-Masters, having troubles to understand your aim.

You should offer more input —> to get more output :wink:

I have two collections on my content manager. The two of them are one for man, one for woman. I want to seperate these two collections in a way that they can’t watch each other info when I create member page or dynamic page. Thanks ahead.

You will have to create a DATABASE in which you will have informations about every users gender (male/female).

When a user wants to enter one of the two pages by a click onto a button —> take ID of that user —> query the DB where you have all the mentioned info about GENDER, search for that USER (ID) —> find out its GENDER and make an simple if-else-query …

if (foundGender === MALE) {console.log("Go to MALE-PAGE"}
else {console.log("Sorry humanbeeing with boo... not allowed")}

:grin: sorry for my humor

Well, now that you got it worked out how to save the data to two different collections, I’ve gotta ask why? It would be much better to have only one collection with everything saved, and have a field for gender. This will result in streamlined code, and will be much easier to maintain.

You can achieve privacy by ensuring that your collections have proper permission settings, and by performing all of your database queries in backend files. As the site owner/admin, you can access all of the collections in backend code, while regular site visitors/members will be blocked.

You don’t need to “divide members by category”. You can achieve the proper level of privacy and security by performing a query of the collection based on the ID of the logged in user. That person’s data will then only be available to that person and no one else.

Thank you. I guess I spent 17 hours strait for nothing :face_with_hand_over_mouth:

Not for nothing. You ended up learning. That’s worth something.

1 Like

I thought If I succseed doing that this save me from coding

Believe me - properly organizing your database will save you much more coding, will make the site easier to maintain, will make it more understandable, and will save you a lot of headaches.

1 Like

Yeh you right :sneezing_face::sob::sob::sob:

@yisrael-wix That’s it! This is the learning process!

And like Yisrael mentioned it → you will have a lot of head-aches, before you will get your end-result —> a normal coding-procedure :wink: