简体   繁体   中英

Role assignment, management, and permissions in Parse (Parse.com)

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.

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

https://www.parse.com/questions/role-assignment-management-and-permissions#answer-the-role-does-not-need-to-be-public-writable-if-you

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM