BaiduBCS::set_bucket_acl PHP Method

set_bucket_acl() public method

设置bucket的acl,有三种模式, (1).设置详细json格式的acl; a. $acl 为json的array b. $acl 为json的string (2).通过acl_type字段进行设置 a. $acl 为BaiduBCS::$ACL_TYPES中的字段
public set_bucket_acl ( string $bucket, string $acl, array $opt = [] ) : boolean | BCS_ResponseCore
$bucket string (Required)
$acl string (Required)
$opt array (Optional)
return boolean | BCS_ResponseCore
    public function set_bucket_acl($bucket, $acl, $opt = array())
    {
        $this->assertParameterArray($opt);
        $result = $this->analyze_user_acl($acl);
        $opt = array_merge($opt, $result);
        $opt[self::BUCKET] = $bucket;
        $opt[self::METHOD] = 'PUT';
        $opt[self::OBJECT] = '/';
        $opt[self::QUERY_STRING] = array(self::ACL => 1);
        $response = $this->authenticate($opt);
        $this->log($response->isOK() ? "Set bucket acl success!" : "Set bucket acl failed! Response: [" . $response->body . "]", $opt);
        return $response;
    }