Updated on 2024-08-15 GMT+08:00

Granting All Accounts the Read Permission for Certain Objects

Scenario

Enterprise A stores a large volume of map data in OBS, and offers the data for public query. This enterprise sets a read permission for all accounts, and provides the data URLs on the Internet. Then all users can read or download the data through the URLs.

Configuration Precautions

In this case, the preset template Object Read-Only allows all accounts to perform the following actions on specified objects in a bucket:

  • GetObject (to obtain object content and metadata)
  • GetObjectVersion (to obtain the content and metadata of a specified object version)
  • GetObjectVersionAcl (to obtain the ACL of a specified object version)
  • GetObjectAcl (to obtain the object ACL)
  • RestoreObject (to restore objects from Archive storage)

Procedure

  1. In the navigation pane of OBS Console, choose Buckets.
  2. In the bucket list, click the bucket name you want to go to the Objects page.
  3. In the navigation pane, choose Permissions > Bucket Policies.
  4. On the Bucket Policies page, click Create.
  5. Choose a policy configuration method you like. Visual Editor is used here.
  6. Configure parameters for a bucket policy.

    Figure 1 Configuring bucket policy parameters
    Table 1 Parameters for configuring a bucket policy

    Parameter

    Description

    Policy Name

    Enter a policy name.

    Policy content

    Effect

    Select Allow.

    Principals

    • Select All accounts.

    Resources

    • Select Specified objects.
    • Enter an object name prefix for the resource path.
      NOTE:
      1. You can click Add to specify multiple resource paths.
      2. You can specify a specific object or an object set. * indicates all objects in the bucket.

        For one object, enter object name.

        To specify a set of objects, enter Object name prefix*, *Object name suffix, or *.

    Actions

    • Choose Use a template.
    • Select Object Read-Only.

  7. Ensure all the configurations are correct and click Create.

Verification

After the permission is set, click the object. 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.