Parse.com - 通过代码在用户 table 中创建字段

Parse.com - create fields in User table from code

通常使用 Parse 代码,我可以使用 put 添加我想要的任何字段,如果它们不存在于 table 中(并且 table 权限允许)解析将创建字段。但是,这不适用于用户 table。如果我从 Web 界面添加字段,一切正常,但如果不是,代码将不会创建字段。这是用户 table 特有的限制,还是我遗漏了什么?该权限允许客户端创建字段。以下是 Android 代码。

currentUser.setEmail(uname);
currentUser.setUsername(uname);
currentUser.put("phoneNumber", settings.getAgentPhone());
currentUser.put("company", settings.getAgentCompanyName());
currentUser.put("agentName", settings.getAgentName());
currentUser.saveEventually();

我认为用户 class 有某种 "special restrictions"。您是否尝试过在 Cloud Code 中使用主密钥?

Parse.Cloud.useMasterKey();

使用主密钥基本上可以让您绕过大部分(如果不是全部的话)限制(基本上给您管理权限)

我在这里找到了答案:Parse.com: with parseUser, how can I save data in a column I created in parse from the class?

出于某种原因,您无法通过客户端代码的保存操作向用户 table 添加列,但您可以通过 "signup" 操作(signUpsignUpInBackground).我没有在解析文档中找到对此的任何引用。