Creating a Custom Bucket Policy (JSON View)
If you are familiar with the JSON syntax and OBS bucket policies, you can code a bucket policy in the JSON view. There is no limit on the number of bucket policies (statements) for a bucket. However, the total size of JSON descriptions of all bucket policies in a bucket cannot exceed 20 KB.
Procedure
- In the navigation pane on the left of OBS Console, choose Object Storage.
- In the bucket list, click a bucket name, and then the Overview page of the bucket is displayed.
- In the navigation pane on the left, click Permissions > Bucket Policy.
- In the upper right corner of the page, select JSON and click Edit Bucket Policy.
- The following is an example policy edited in JSON:
{ "Statement":[ { "Action":[ "CreateBucket", "DeleteBucket" ], "Effect":"Allow", "Principal":{ "ID":[ "domain/account ID", "domain/account ID:user/User ID" ] }, "Condition":{ "NumericNotEquals":{ "Referer":"sdf" }, "StringNotLike":{ "Delimiter":"ouio" } }, "Resource":"000-02/key01" } ] }Table 1 Parameter description Parameter
Description
Action
Actions on which the bucket policy takes effect. For details, see Policy Format.
Effect
For details about bucket policy effects, see Policy Format.
Principal
Authorized users on whom the bucket policy takes effect. You can obtain the user ID on the My Credential page by logging in to the console as the user to be authorized. Principal format:
- "domain/account ID" (when the principal is an account)
- "domain/account ID:user/User ID" (when the principal is a user under an account)
Condition
Conditions under which the bucket policy takes effect. For details, see Policy Format.
Resource
Resources on which the bucket policy takes effect. For details, see Policy Format.
- Click Save.
Last Article: Creating a Custom Bucket Policy (Visual Editor)
Next Article: Replicating Bucket Policies
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.