简体   繁体   English

Parse中的角色分配,管理和权限(Parse.com)

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

Roles in Parse use ACL for permissions. Parse中的 角色使用ACL进行权限。

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: 对于寻找解决方案的人来说,Parse网站上已经解决了这个问题:

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. 如果要在注册时自动为用户分配角色,可以在Cloud Code中添加使用主密钥修改角色的afterSave处理程序。

afterSave: https://www.parse.com/docs/cloud_code_guide#save afterSave: https ://www.parse.com/docs/cloud_code_guide#save

useMasterKey: https://parse.com/docs/cloud_code/symbols/Parse.Cloud.html#.useMasterKey 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 https://www.parse.com/questions/role-assignment-management-and-permissions#answer-the-role-does-not-need-to-be-public-writable-if-you

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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