In my game, a user can cause damage to another user, and take some of their gold. The gold variable is stored in the other users PFUser object. How can one user change the v
The best solution would be to handle it with a cloud code. Manipulating a non authenticated PFUser object from client side will raise some security issues. Have a cloud function like:
Parse.Cloud.define("stealGold", function(request, response) {
var query = new Parse.Query(Parse.User);
query.equalTo("objectId", request.params.targetObjectId);
query.find({useMasterKey : true}).then(function(results) {
// process the result of the query here
// Save the user object
});
});
You may read about it in docs here: https://parse.com/docs/data#security-cloudcode