Parse Android: updating ParseObject containing an array of ParseUsers throws UserCannotBeAlteredWithoutSessionError

im working on an android app.

I have a custom class that has relationships with TWO ParseUsers and other fields. As suggested by the docs, I used an array (with the "usersArray" key) to store pointers for two ParseUsers, because I want to be able to use "enable" to include users when I request my custom class. I can create a new object and save it successfully.

//My custom parse class:
CustomObject customObject = new CustomObject();
ArrayList<ParseUser> users = new ArrayList<ParseUser>();
users.add(ParseUser.getCurrentUser());
users.add(anotherUser);
customObject.put("usersArray", users);
//I also store other variable which i would like to update later
customObject.put("otherVariable",false); 
customObject.saveInBackground();

In addition, I can successfully execute the request:

ParseQuery<CustomObject> query = CustomObject.getQuery();
query.whereEqualTo("usersArray", ParseUser.getCurrentUser());
query.whereEqualTo("usersArray", anotherUser);
query.include("usersArray");
query.findInBackground( .... );

CustomObject. CustomObject , "otherVariable" true , UserCannotBeAlteredWithoutSessionError java.lang.IllegalArgumentException: Cannot save a ParseUser that is not authenticated.

CustomObject customObject = customObject.get(0); //From the query
customObject.put("otherVariable", true);
customObject.saveInBackground(); // EXCEPTION

, - , , ParseUser. , CustomObject.

¿ ?

+4
1

, , Parse ACL , users.isAuthenticated(), , .

false, . . .

, , - , ACL, .

0

All Articles