XCEPTION
XCEPTION

Reputation: 1753

Saving or updating ParseUser in cloud code

I am getting the error response as "user objects cannot allow writes from other users" when trying to signUp or update a ParseUser in cloud code. As specified by the Parse team I am using Parse.Cloud.useMasterKey() so that I can bypass the restrictions. Where possibly am I going wrong? I am confused as this code was previously working. Thanks in advance.

Upvotes: 3

Views: 856

Answers (1)

kingspeech
kingspeech

Reputation: 1836

If it is possible, can you provide some codes related with your problem? For example below code is updating the Parse User name column successfully (tested on Parse cloud);

   Parse.Cloud.define("test", function(request, response) {
   Parse.Cloud.useMasterKey();
   var query = new Parse.Query(Parse.User);
   query.equalTo("objectId", request.params.objectId);
   query.first({
      success: function(object) {
         object.set("name", request.params.name);
         object.save();
         response.success("Success Message");
      },
      error: function(error) {
         response.error("Error Message");
      }
   });
});

However, if one of the ParseUser tries to update another then it is highly possible the problem is related with the ACL. If you provide codes, it is really helpful. Hope this helps,

Regards.

Upvotes: 2

Related Questions