You can call DeleteBucketPolicy to delete the policies configured for a specified bucket.
Bucket policies provide resource-based authorization for users. Bucket policies apply to the following scenarios:
- Authorize RAM users of other accounts to access your OSS resources.
You can authorize RAM users of other accounts to access your OSS resources.
- Authorize anonymous users to access your OSS resources using specific IP addresses
or IP ranges.
In some cases, you must authorize anonymous users to access OSS resources using specific IP addresses or IP ranges. For example, confidential documents of an enterprise are only allowed to be accessed within the enterprise but not in other regions. Previously, configuring RAM policies for every user was a tedious and complex task because of the potential for a large number of internal users. To resolve this issue, you can configure access policies with IP restrictions based on bucket policies to authorize a large number of users easily and efficiently.
For more information about bucket policy configurations and use cases, see Use bucket policies to authorize other users to access OSS resources. For more information about bucket policy syntax, see Policy structure and grammar.
- Sample requests
DELETE /? policy Host: oss-example.oss-cn-hangzhou.aliyuncs.com Date: Thu, 21 Feb 2019 12:55:10 GMT Authorization: OSS xxxxxxxx:xxxxxxxxxxxxxx
- Sample responses
204 (No Content) content-length: 0 server: AliyunOSS x-oss-server-time: 31 connection: keep-alive x-oss-request-id: 5C6E9FAF31A13327124B**** date: Thu, 21 Feb 2019 12:55:11 GMT