Reputation: 5595
Roles in Parse use ACL for permissions.
In order to add a role to a user upon registry, it is my understanding that the role needs to be read and write accessible. My concern is that with it being write accessible by the public means that anyone would be able to remove users from this role.
Is this true and if so how can I get around this? Some solid examples on role assignment and management would be very helpful.
Upvotes: 4
Views: 3288
Reputation: 5595
This was answered over on the Parse site for anyone looking for a solution:
The Role does not need to be public-writable. If you want to automatically assign users a role upon registration, you could add an
afterSave
handler in Cloud Code that uses the Master Key to modify the role.afterSave: https://www.parse.com/docs/cloud_code_guide#save
useMasterKey: https://parse.com/docs/cloud_code/symbols/Parse.Cloud.html#.useMasterKey
Upvotes: 4