Friday, 15 April 2011

parse.com - Parse Android: update ParseObject containing an array of ParseUsers throws UserCannotBeAlteredWithoutSessionError -


im working on an Android app.

I have relationships with two ParseUsers who have suggested a custom class and other field docs, I have an array to store signals for two ParseUsers (with the key "usersArray") Because I used to use "include" when I want to be able to include my custom class query users I can create a new object and save it successfully.

  // My custom parsing class: custom object custom object = new custom object (); ArrayList & LT; ParseUser & gt; Users = New Arrestists & lt; Parsusar & gt; (); Users.add (ParseUser.getCurrentUser ()); Users.add (anotherUser); CustomObject.put ("UserArray", User); // I also store other variables which I would like to update later customObject.put ("Other variable", incorrect); CustomObject.saveInBackground ();  

In addition, I can successfully query with:

  Parsquin & lt; Custom Object & gt; Query = CustomObject.getQuery (); Query.whereEqualTo ("usersArray", ParseUser.getCurrentUser ()); Query.whereEqualTo ("usersArray", other user); Query.include ("usersArray"); Query.findInBackground (....);  

My problem is when trying to update one of those custom objects, to retrieve CustomObject with the previous query, if I right say the value of "otherVariable" After trying to save and save the object, I'm getting a UserCannotBeAlteredWithoutSessionError or java.lang.IllegalArgumentException: a ParseUser that can not be saved exception is not authenticated .

  CustomObject customObject = customObject.get (0); // customObject.put from query ("other variable", true); CustomObject.saveInBackground (); // continuous  

I can see that it is trying to update something in some way that is trying to include a parser in the pointer. But im not modifying the user, I just want to update one of the areas of CustomObject.

¿Is there no way to solve this problem?

"itemprop =" text ">

may be late but parsed so that you can check if your real users .isAuthenticated () Users have ACL or public write public and private write.

If incorrect, log in with the user and try again. Note: You can not edit two information at them without having to log out and relogging at the same time

Another thing you can do is use roles and ACLs Using an administrator role is defined. Which can write to all users


No comments:

Post a Comment