2

I'm getting {"code":101,"error":"object not found for update"} when calling save on my role after adding a user to it, all on Cloud Code.

Sample code:

var role_query = new Parse.Query('_Role')
role_query.equalTo('name', 'USER')
role_query.first().then(function(role) {
  role.getUsers().add(user)
  role.save()
})

1 Answer 1

3

The error was that I didn't have permission to update the role.

Solution was using Parse.Cloud.useMasterKey() at the beginning of the Cloud Code function.

In case you need to update roles on the client:

https://www.parse.com/questions/role-cant-assign-user-in-js

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.