Expand my Community achievements bar.

SharedProperty.canUserEdit is always FALSE

Avatar

Level 4

im successfully creating a session like this:

_authenticator = new AdobeHSAuthenticator();
_authenticator.addEventListener(AuthenticationEvent.AUTHENTICATION_FAILURE, _onAuthenticationError);
_authenticator.addEventListener(AuthenticationEvent.AUTHENTICATION_SUCCESS, _onAuthenticationSuccess);

_connectSession = new ConnectSession();
_connectSession.addEventListener(SessionEvent.SYNCHRONIZATION_CHANGE, _onConnectSessionSync);
_connectSession.roomManager.addEventListener(RoomManagerEvent.ROOM_STATE_CHANGE, _onConnectSessionRoomStateChange);
_connectSession.authenticator = _authenticator;

then once its sync'ed i'm doing this:

someProp = new SharedProperty();
someProp.sharedID = "sharedTranscriptID";
someProp.connectSession = _connectSession;
someProp.subscribe();
someProp.addEventListener(CollectionNodeEvent.SYNCHRONIZATION_CHANGE, _onSomePropSync);
someProp.addEventListener(CollectionNodeEvent.MY_ROLE_CHANGE, _on
SomePropCanEdit);


if (localUser.role == UserRoles.OWNER) someProp.allowUserToEdit(localUser.userID);

localUser is just the chat OWNER's UserDescription. it doesn't matter how many events i listen to or where or when i call:

_transcriptID.allowUserToEdit(localUser.userID);

the result is always the same: SharedProperty.canUserEdit is always FALSE.

i'm going to use a SharedCollection because i know i can just do 'addItemAt' and it'll just work, until/unless someone can suggest quite why SharedProperty.canUserEdit is always FALSE.

1 Reply

Avatar

Former Community Member

Hi,

Thanks for letting us know. This was indeed a bug on our side which I have fixed now, and it will be up updated in the next drop. If you are linking the source, these are the changes you need to do.

The functions that needs to be updated in SharedProperty are

          /**
         * Determines whether the specified user can edit the property.
         *
         * @param p_userID The user to query regarding whether they can edit.
         */

         public function canUserEdit(p_userID:String):Boolean
        {
            return (_collectionNode.canUserPublish(p_userID,_nodeNameText));
        }


        /**
         * Allows the current user with an owner role to grant the specified user
         * the ability to edit the property.
         *
         * @param p_userID The userID of the user being granted editing privileges.
         *
         */
        public function allowUserToEdit(p_userID:String):void
        {
            // If I can't configure, cancel.
            if(!_collectionNode.canUserConfigure(userManager.myUserID,_nodeNameText)){
                return;
            }
           
            _collectionNode.setUserRole(p_userID, UserRoles.PUBLISHER, _nodeNameText);
        }


Thanks again. We depend on your feedbacks for improving our framework.

Regards

Hironmay Basu