Estos contenidos se han traducido de forma automática para su comodidad, pero Huawei Cloud no garantiza la exactitud de estos. Para consultar los contenidos originales, acceda a la versión en inglés.
Centro de ayuda/ Object Storage Service/ Guía del usuario/ Control de permisos/ Application Cases/ Granting Anonymous Users Permission to Access Folders
Actualización más reciente 2024-09-18 GMT+08:00

Granting Anonymous Users Permission to Access Folders

If all objects in a folder need to be accessible to anonymous users, you can configure a bucket policy or an object policy to grant anonymous users the permission to access the folder. In this example, a bucket policy is used. If you want to use an object policy to grant permission, select the target folder and configure an object policy. Parameters in both types of policies are the same.

Procedure

  1. En el panel de navegación de OBS Console, elija Object Storage.
  2. En la lista de bucket, haga clic en el nombre del bucket que desee. Se muestra la página Objects.
  3. In the navigation pane, choose Permissions > Bucket Policy.
  4. Click Create.
  5. In the first row of the template list, click Create Custom Policy on the right.
  6. Configure parameters listed in the table below.

    Tabla 1 Authorizing folder access permissions to anonymous users

    Parameter

    Description

    Policy View

    Visual editor

    Policy Name

    Enter a custom name.

    Policy Content

    Effect

    Allow

    Principal

    • Anonymous user
    • User Policy: Include specified users.

    Resources

    • Resource scope: Object in bucket. Specify objects.
    • Resource path: If the folder name is folder-001, enter folder-001/*, indicating all objects in the folder.
    • Resource Policy: Include specified resources.

    Actions

    • GetObject
    • Operation Strategy: Include selected actions.

  7. Click Next in the lower right corner to confirm the policy configuration.
  8. Click Create in the lower right corner.

Verification

  1. After the permission is successfully configured, select an object in the folder and click the object name to view its details. The object link (URL) is displayed on the details page. Share the URL over the Internet, so that all users can access or download the object through the Internet.
  2. An anonymous user can use the URL to access the object in a browser.