Sync Document creation w/Permission

Hey, trying to create a sync doc and assign access permissions when using ACLs from a server. But it looks like I'm getting a race condition where our websocket js client is seeing it create and trying to access it in the ... second? before permissions are assigned?

then the js seems to quit trying (bc it was denied no reason to keep asking, i get it), even though it would now have permissions?

I'm not seeing anything in Document.creator() that would let me pass a DocumentPermission object in to create with-permissions immediately? is there a way for that?

Best Answer

  • dsineln
    dsineln
    Answer ✓

    Hey @attriel . There is no way to create object with predefined set of extended permissions, by default permissions always presume that only the originating identity has access to a Sync object. So short answer to your question is "no, there is no way to pass permissions to Document.creator".

    Depending on how you built the notification to the websocket JS client, it might be possible (as a workaround) to notify the client only when the permissions are assigned to the Sync object by your server.

Answers

If this is an emergency, please contact Twilio Support. This is not an official Support channel. https://support.twilio.com/
Have an urgent question?
Please contact Twilio Support. This is not an official Support channel.
Contact Support