Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
解析REST API将ACL设置为对象_Rest_Curl_Parse Platform - Fatal编程技术网

解析REST API将ACL设置为对象

解析REST API将ACL设置为对象,rest,curl,parse-platform,Rest,Curl,Parse Platform,我正在尝试为通过Parse REST API创建的对象设置ACL权限。我希望它只有公共读取权限。只有服务器可以创建或修改类中的对象。我阅读了有关如何设置ACL权限的parse REST文档 当我运行以下命令时: $InputData = array('votes' => 1, 'ACL' => array('*' => array('read' => true, 'write' => false)), 'user' => array('__type' =>

我正在尝试为通过Parse REST API创建的对象设置ACL权限。我希望它只有公共读取权限。只有服务器可以创建或修改类中的对象。我阅读了有关如何设置ACL权限的parse REST文档

当我运行以下命令时:

$InputData = array('votes' => 1, 'ACL' => array('*' => array('read' => true, 'write' => false)), 'user' => array('__type' => 'Pointer', 'className' => '_User', 'objectId' => $objectId));

$rest = curl_init();
curl_setopt($rest,CURLOPT_URL,$url);
curl_setopt($rest,CURLOPT_PORT,443);
curl_setopt($rest,CURLOPT_POST,1);
curl_setopt($rest,CURLOPT_POSTFIELDS, json_encode($InputData));
curl_setopt($rest,CURLOPT_HTTPHEADER, 
    array("X-Parse-Application-Id: " . $appId,
        "X-Parse-Master-Key: " . $restKey,
        "Content-Type: application/json"));
我得到:

{"code":123,"error":"Invalid acl {\"*\":{\"read\":false,\"write\":false}}"} 1
我的代码有什么问题,特别是ACL部分?救命啊

希望有帮助

curl -X POST \
-H "Content-Type: application/json" \
-H "X-Parse-Application-Id: xxxxxxxxxxxxxxx" \
-H "X-Parse-REST-API-Key: xxxxxxxxxxxxx" \
-H "X-Parse-Session-Token: xxxxxxxxxxxxxx" \
-d "{\"name\":\"MyName\", \"ACL\": {\"ErKLiQfj8Q\" : { \"read\": true, \"write\": true }, \"*\" : {}}}" \
https://api.parse.com/1/classes/Tasks
JSON obj

{
  "name":"MyName",
  "ACL":
    {
        "ErKLiQfj8Q" : { "read": true, "write": true },
        "*" : {}
    }
}