Public 更新禁用时无法更新 [PFUser currentUser]
Unable to update [PFUser currentUser] when Public Updated Disabled
我最近试图锁定解析项目的安全性,并且已禁用 public create 除外。
但是在这样做之后,如果我尝试 link 现有用户到 Facebook,如下所示:
[PFFacebookUtils linkUser:[PFUser currentUser] permissions:nil block:^(BOOL succeeded, NSError *error) { /* ... */ }];
我在控制台上看到以下错误:
2015-02-04 00:11:19.856 Walker[43201:381190] Error: This user is not allowed to perform the update operation on _User. You can change this setting in the Data Browser. (Code: 119, Version: 1.5.0)
尽管当前用户对自己具有读/写权限:
如果我再次为用户 class 启用 public 'Updates',这个问题会消失吗?
有什么方法可以在不启用 public 访问权限的情况下对当前用户启用更新?
我最终从 Parse Google 组 ( https://groups.google.com/d/msg/parse-developers/JFMrXheHgdo/1dw_6dl1EmUJ )
的 Hector Ramos 那里得到了以下答案
In order to link a user to Facebook, the user object must be modified.
You'll need to turn on Updates for this class. Per-object ACLs cannot
increase the scope of permissions past what the class-level ACLs are
providing, as far as I know.
我认为这意味着我必须为 class 启用更新才能进行任何更新。
我仍然有点担心这可能会允许对我的用户帐户进行未经授权的更新(因为这个答案不是 100% 清楚)。为了安全起见,我还在保存挂钩之前添加了一个 CloudCode,它将用户访问控制列表 (ACL) 设置为仅允许他们访问此对象(根据我的应用程序要求)。
Parse.Cloud.beforeSave(Parse.User, function(request, response) {
// Set ACL for new User to only that user
request.object.setACL(new Parse.ACL(Parse.User.current()));
response.success();
});
我最近试图锁定解析项目的安全性,并且已禁用 public create 除外。
但是在这样做之后,如果我尝试 link 现有用户到 Facebook,如下所示:
[PFFacebookUtils linkUser:[PFUser currentUser] permissions:nil block:^(BOOL succeeded, NSError *error) { /* ... */ }];
我在控制台上看到以下错误:
2015-02-04 00:11:19.856 Walker[43201:381190] Error: This user is not allowed to perform the update operation on _User. You can change this setting in the Data Browser. (Code: 119, Version: 1.5.0)
尽管当前用户对自己具有读/写权限:
如果我再次为用户 class 启用 public 'Updates',这个问题会消失吗? 有什么方法可以在不启用 public 访问权限的情况下对当前用户启用更新?
我最终从 Parse Google 组 ( https://groups.google.com/d/msg/parse-developers/JFMrXheHgdo/1dw_6dl1EmUJ )
的 Hector Ramos 那里得到了以下答案In order to link a user to Facebook, the user object must be modified. You'll need to turn on Updates for this class. Per-object ACLs cannot increase the scope of permissions past what the class-level ACLs are providing, as far as I know.
我认为这意味着我必须为 class 启用更新才能进行任何更新。
我仍然有点担心这可能会允许对我的用户帐户进行未经授权的更新(因为这个答案不是 100% 清楚)。为了安全起见,我还在保存挂钩之前添加了一个 CloudCode,它将用户访问控制列表 (ACL) 设置为仅允许他们访问此对象(根据我的应用程序要求)。
Parse.Cloud.beforeSave(Parse.User, function(request, response) {
// Set ACL for new User to only that user
request.object.setACL(new Parse.ACL(Parse.User.current()));
response.success();
});