你好,有复现的代码和 cURL 日志吗?

已经解决了~谢谢啦

你是怎么解决的,我也出现了这个问题了

请详细描述问题,包括 SDK 版本、相关代码片段、开启调试日志后的详细报错信息(包括具体网络请求)。

019-07-26 19:27:51.536161+0800 DSLDIC[36134:912997] [💚DEBUG] -[AVPaasClient performRequest:success:failure:wait:] [Line 621]

------ BEGIN LeanCloud REST Request -------
path: /1.1/classes/ToDigTable
curl: curl -i -k -X GET -G --compressed -H 'Accept: application/json' -H 'Content-Type: application/json; charset=utf-8' -H 'X-LC-Id: de2Ymyac0Bsj6RPN7dHAMAYS-gzGzoHsz' -H 'X-LC-Prod: 1' -H 'User-Agent: AVOS Cloud iOS-v11.6.2 SDK' -H 'X-LC-Session: 1s6wj9hszwju0fcqg57qihl9e' -H 'Accept-Encoding: gzip' -H 'Accept-Language: zh-Hans-US;q=1, en;q=0.9' --data-urlencode 'where={"$and":[{"$and":[{"Status":{"type":"Pointer","className":"Album","objectId":"5d3a752643e78c006ef28933"}}]},{"$and":[{"digUser":{"type":"Pointer","className":"_User","objectId":"5cd8212a17b54d0075abdcd1"}}]}]}' "https://de2ymyac.api.lncld.net/1.1/classes/ToDigTable"
------ END --------------------------------
2019-07-26 19:27:51.614269+0800 DSLDIC[36134:913907] [💚DEBUG] -[AVPaasClient performRequest:success:failure:wait:]blockinvoke [Line 689]

------ BEGIN LeanCloud REST Response ------
path: /1.1/classes/ToDigTable
cost: 77.724ms
response: {
results = (
{
Status = {
"__type" = Pointer;
className = Album;
objectId = 5d3a752643e78c006ef28933;
};
createdAt = "2019-07-26T10:26:58.597Z";
digUser = {
"__type" = Pointer;
className = "_User";
objectId = 5cd8212a17b54d0075abdcd1;
};
objectId = 5d3ad572ba39c80068c58862;
updatedAt = "2019-07-26T10:26:58.597Z";
}
);
}
------ END --------------------------------
2019-07-26 19:27:51.615685+0800 DSLDIC[36134:913907] [💚DEBUG] -[AVPaasClient performRequest:success:failure:wait:] [Line 621]

------ BEGIN LeanCloud REST Request -------
path: /1.1/batch/save
curl: curl -i -k -X POST -d '{"requests":[{"path":"\/1.1\/classes\/Album\/5d3a752643e78c006ef28933","method":"PUT","body":{"internalId":"5d3a752643e78c006ef28933","digNumber":{"amount":-1,"op":"Increment"},"ToDigs":{"objects":[{"type":"Pointer","className":"ToDigTable","objectId":"5d3ad572ba39c80068c58862"}],"op":"Remove"}}}]}' --compressed -H 'Accept: application/json' -H 'Content-Type: application/json; charset=utf-8' -H 'X-LC-Id: de2Ymyac0Bsj6RPN7dHAMAYS-gzGzoHsz' -H 'X-LC-Prod: 1' -H 'User-Agent: AVOS Cloud iOS-v11.6.2 SDK' -H 'X-LC-Session: 1s6wj9hszwju0fcqg57qihl9e' -H 'Accept-Encoding: gzip' -H 'Accept-Language: zh-Hans-US;q=1, en;q=0.9' "https://de2ymyac.api.lncld.net/1.1/batch/save"
------ END --------------------------------
2019-07-26 19:27:51.671848+0800 DSLDIC[36134:913754] [💚DEBUG] -[AVPaasClient performRequest:success:failure:wait:]blockinvoke [Line 667]

------ BEGIN LeanCloud REST Response ------
path: /1.1/batch/save
cost: 55.807ms
response: Error Domain=com.LeanCloud.ErrorDomain Code=403 "Forbidden writing by object's ACL." UserInfo={NSLocalizedFailureReason=Forbidden writing by object's ACL., com.alamofire.serialization.response.error.data=<7b22636f 6465223a 3430332c 22657272 6f72223a 22466f72 62696464 656e2077 72697469 6e672062 79206f62 6a656374 27732041 434c2e22 7d>, com.leancloud.restapi.response.error={
code = 403;
error = "Forbidden writing by object's ACL.";
}}
------ END --------------------------------
2019-07-26 19:27:51.721169+0800 DSLDIC[36134:912997] ===删除digPost对象错误==未能完成该操作。Forbidden writing by object's ACL.

  • (void)digAction:(UIButton *)btn event:(id)event
    {
    NSSet *touches =[event allTouches];
    UITouch *touch =[touches anyObject];
    CGPoint currentTouchPosition = [touch locationInView:_tableView];
    NSIndexPath *indexPath= [_tableView indexPathForRowAtPoint:currentTouchPosition];
    if (indexPath!= nil)
    {
    CommentModel * model = self.commentsArray[indexPath.row];
    //点赞的ID
    AVQuery *digObid = [AVQuery queryWithClassName:TODIGTABLE];
    //[digObid whereKey:@"Status" equalTo:[model.status objectForKey:@"objectId"]];
    [digObid whereKey:@"Status" equalTo:model.status ];
    //点赞的用户ID
    AVQuery *todigUserid = [AVQuery queryWithClassName:TODIGTABLE];
    [todigUserid whereKey:@"digUser" equalTo:[AVUser currentUser]];
    AVQuery *query = [AVQuery andQueryWithSubqueries:[NSArray arrayWithObjects:digObid,todigUserid,nil]];
    [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
    if (!error) {
    if (objects.count != 0) {
    if (model.digArray.count == 0 ) {
    model.digCountStr = @"0";
    }else
    {
    model.digCountStr = [NSString stringWithFormat:@"%lu",(unsigned long)model.digArray.count - 1];
    }
    [[LeadCloudTools shareIntance]digOfAlbum:model.status isDel:YES digObj:objects[0]];
    [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
    }else{
    model.digCountStr = [NSString stringWithFormat:@"%lu",(unsigned long)model.digArray.count + 1];
    [[LeadCloudTools shareIntance]digOfAlbum:model.status isDel:NO digObj:nil];
    [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
    }
    }else{
    NSLog(@"==点赞请求属性报错===%@",[error localizedDescription]);
    }
    }];
}

}

你好,您这边的报错已经提示了 ACL 权限问题。

您的数据表 ToDigTable 中每个对象有如下 ACL 权限,只允许一个用户 5cefe46fa673f5006843bdac 写入数据:

 "ACL": {
    "*": {
      "read": true,
      "write": false
    },
    "5cefe46fa673f5006843bdac": {
      "read": true,
      "write": true
    }
  }

请检查当前写入数据的用户 ID。

那我这边应该怎么修改,我都修改成所有助用户,不行吗?

那我怎么修改啊,我想所有用户都能访问,有读写的权限。下边这个图片是修改的权限,但是他依然报错

更正一下我上面的回复,您这个表 ToDigTable 设置了默认额 ACL ,只有对象创建者可读、可写,其他人可读、不可写。

{"_owner":{"read":true,"write":true},"*":{"read":true,"write":false}}

如果更改默认 ACL 权限,可编辑 ACL 列,修改其默认值属性。在控制台点击 ACL 列的右边倒三角,选择「编辑」即可。

{"*":{"read":true,"write":true}}