Expand my Community achievements bar.

SOLVED

Access CollectionNode when logged in as guest

Avatar

Level 2

Hi,

  I am attempting to do some custom messaging by using the CollectionNode in action script.  When I am logged in as host I can use the collectionNode with no problems, but when I am logged in as a guest (all my users will be 'guests') - I get the error 'insufficient permissions to create a new CollectionNode. You must be an OWNER of the room to add new multi-user features to it. Log in with developer credentials in order to do so.'

  I think the problem is that in my code I have:

private var messaging:CollectionNode = new CollectionNode();

  I have a CollectionNode ( named 'Messaging') for my room, which was created using the room console.  Is there a way I can access this already created CollectionNode through actionscript (jnstead of instantiating a new one)?

  Hope my question makes sense - I am really stuck and probably missing something obvious.  Can anyone help me out?

thanks

Mark

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Hi Mark,

Here is a way to access a collectionnode created using devconsole.

For e.g. Let's say you created a CollectionNode called "myCollectionNode" using devconsole, then the way you can access it as a guest is

private var messaging:CollectionNode = new CollectionNode();

messaging.sharedID = "myCollectionNode" ;

messaging.connectSession = session ;

messaging.subscribe() ;

i.e. you need to assign the name to sharedID property and assign a connectSession object to connectSession property. And then when you call subscribe, you get all the data.

Hope this helps.

Thanks

Hironmay Basu

View solution in original post

2 Replies

Avatar

Correct answer by
Former Community Member

Hi Mark,

Here is a way to access a collectionnode created using devconsole.

For e.g. Let's say you created a CollectionNode called "myCollectionNode" using devconsole, then the way you can access it as a guest is

private var messaging:CollectionNode = new CollectionNode();

messaging.sharedID = "myCollectionNode" ;

messaging.connectSession = session ;

messaging.subscribe() ;

i.e. you need to assign the name to sharedID property and assign a connectSession object to connectSession property. And then when you call subscribe, you get all the data.

Hope this helps.

Thanks

Hironmay Basu

Avatar

Level 2

Hi Hironmay,

  Thanks that did help!  The issue was that I was not setting the sharedID of the CollectionNode.   It makes sense now that it should be set to the name of the CollectionNode I created in the dev console.

cheers

Mark

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----