JMA
JMA

Reputation: 994

how to share a document to more than one users in mongodb with meteor

I want to save a document to a collection in MongoDB. I have users collections provided by accounts-ui and accounts-password in meteor. I would like to save documents that owned by multiple users.

I know I can do this using insert function. But I would like to know what is the better way to do this? How can I do this?

For example, the user created an object and save it to the collection. Then the user will share it to other users.

Upvotes: 0

Views: 41

Answers (1)

Mikkel
Mikkel

Reputation: 7777

This is a fairly broad question and therefore hard to answer. One approach could be to use the alanning:roles package which will allow you define roles, and also groups.

Your documents could be assigned to either a role or a group, and then the retrieval code can check their access in returning the documents.

Upvotes: 1

Related Questions