# `LibOss.Api.Acl`
[🔗](https://github.com/tt67wq/lib-oss/blob/main/lib/lib_oss/api/acl.ex#L1)

OSS访问控制列表(ACL)管理相关API

提供对象和存储桶的ACL权限管理功能。

# `__using__`
*macro* 

创建宏，用于在客户端模块中导入所有ACL管理函数

# `get_bucket_acl`

```elixir
@spec get_bucket_acl(module(), LibOss.Typespecs.bucket()) ::
  {:ok, binary()} | {:error, LibOss.Exception.t()}
```

调用GetBucketAcl接口获取某个存储空间（Bucket）的访问权限（ACL）。

Doc: https://help.aliyun.com/document_detail/31975.html

## Examples

    iex> get_bucket_acl(bucket)
    {:ok, "public-read"}

# `get_object_acl`

```elixir
@spec get_object_acl(module(), LibOss.Typespecs.bucket(), LibOss.Typespecs.object()) ::
  {:ok, binary()} | {:error, LibOss.Exception.t()}
```

调用GetObjectACL接口获取存储空间（Bucket）下某个文件（Object）的访问权限（ACL）。

Doc: https://help.aliyun.com/document_detail/31987.html

## Examples

    iex> get_object_acl(bucket, "/test/test.txt")
    {:ok, "public-read"}

# `put_bucket_acl`

```elixir
@spec put_bucket_acl(module(), LibOss.Typespecs.bucket(), String.t()) ::
  :ok | {:error, LibOss.Exception.t()}
```

调用PutBucketAcl接口设置或修改存储空间（Bucket）的访问权限（ACL）。

Doc: https://help.aliyun.com/document_detail/31976.html

## Examples

    iex> put_bucket_acl(bucket, "public-read")
    :ok

# `put_object_acl`

```elixir
@spec put_object_acl(
  module(),
  LibOss.Typespecs.bucket(),
  LibOss.Typespecs.object(),
  String.t()
) ::
  :ok | {:error, LibOss.Exception.t()}
```

调用PutObjectACL接口修改文件（Object）的访问权限（ACL）。

Doc: https://help.aliyun.com/document_detail/31986.html

## Examples

    iex> put_object_acl(bucket, "/test/test.txt", "public-read")
    :ok

---

*Consult [api-reference.md](api-reference.md) for complete listing*
