I have the following two types of documents
1. space
2. conversation: "space" attribute points to the _id of space
Whenever a conversation starts, a new doc of type "conversation" is created and its attribute "space" contains the _id of a doc of type "space"
What I want to ensure in my sync function is that the user creating a "conversation" document has access to the "space" document pointed.
I originally thought to simply do requireAccess(
doc.space) when a conversation doc is created/updated and make sure to do channel(doc._id) and a access(doc.owner, doc._id) when a space doc is created/updated.
But then I wanted to have public spaces, which anyone has access to. In other words, even if the user isn't explicitly given a access to the channel, I was hoping requireAccess would pass if the document is "public."
I thought I could do this by doing access("GUEST", doc._id) when a space doc is created/updated but that doesn't seem to work.
Is this even possible?
slim