Updated on 2024-02-29 GMT+08:00

Granting Anonymous Users the Read Permission for a Directory

Scenario

If all objects in a folder need to be accessible to anonymous users, you can configure a bucket policy to grant anonymous users the permission to access the folder.

Procedure

  1. In the navigation pane of OBS Console, choose Object Storage.
  2. In the bucket list, click the bucket name you want to go to the Overview page.
  3. In the navigation pane, choose Permissions.
  4. On the Bucket Policies page, click Create Bucket Policy under Custom Bucket Policies.
  5. Configure parameters according to the following table, so that you can grant anonymous users the permission to access the folder and objects in it.

    Table 1 Parameters for granting the permission to access a specified directory

    Parameter

    Value

    Policy Mode

    Select Read-only.

    Principal

    • Include
    • Select Other account, and enter an asterisk (*) as the account ID, indicating all anonymous users.

    Resources

    • Include
    • Select Specific resources.
    • Set this parameter to all objects in the selected folder. If the folder name is folder-001, enter the value folder-001/*.

  6. Click OK.

Verification

After the permission is set, click an object in the folder. Its URL is displayed under Link. Share the URL over the Internet, so that all users can access or download the object through the Internet.