I am interested in saving attributes to users in the database based on actions that are performed by my currentUser. Based on the following code, I get the err
If you want to update a user that is not currently the logged in user you will need to call Parse using the master-key.
You can do this from CloudCode for example;
Parse.Cloud.define('editUser', function(request, response) {
var userId = request.params.userId,
newColText = request.params.newColText;
var User = Parse.Object.extend('_User'),
user = new User({ objectId: userId });
user.set('new_col', newColText);
Parse.Cloud.useMasterKey();
user.save().then(function(user) {
response.success(user);
}, function(error) {
response.error(error)
});
});
and calling it from your iOS project;
[PFCloud callFunction:@"editUser" withParameters:@{
@"userId": @"someuseridhere",
@"newColText": @"new text!"
}];