/** * 获取bucket的ACL配置情况 * * @param string $bucket * @param array $options * @throws OssException * @return string */ public function getBucketAcl($bucket, $options = NULL) { $this->precheckCommon($bucket, NULL, $options, false); $options[self::OSS_BUCKET] = $bucket; $options[self::OSS_METHOD] = self::OSS_HTTP_GET; $options[self::OSS_OBJECT] = '/'; $options[self::OSS_SUB_RESOURCE] = 'acl'; $response = $this->auth($options); $result = new AclResult($response); return $result->getData(); }
/** * 获取object的ACL属性 * * @param string $bucket * @param string $object * @throws OssException * @return string */ public function getObjectAcl($bucket, $object) { $options = array(); $this->precheckCommon($bucket, $object, $options, true); $options[self::OSS_METHOD] = self::OSS_HTTP_GET; $options[self::OSS_BUCKET] = $bucket; $options[self::OSS_OBJECT] = $object; $options[self::OSS_SUB_RESOURCE] = 'acl'; $response = $this->auth($options); $result = new AclResult($response); return $result->getData(); }
public function testParseValidXml() { $response = new ResponseCore(array(), $this->validXml, 200); $result = new AclResult($response); $this->assertEquals("public-read", $result->getData()); }