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/ Limiting the Time When Objects in a Bucket Are Accessible
Actualización más reciente 2024-09-18 GMT+08:00

Limiting the Time When Objects in a Bucket Are Accessible

You can configure the bucket policy to limit the time when objects in a bucket are accessible. In the following example, the access time window is from 2019-03-26T12:00:00Z to 2019-03-26T15:00:00Z.

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 Limiting the time when objects in a bucket are accessible

    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. Select All objects.
    • Resource Policy: Include specified resources.
    NOTA:

    This example only grants permissions for resources in the bucket. If you also want to grant permission for the bucket (for example, the permission to list objects in the bucket), create another custom bucket policy.

    Actions

    • Select * (indicating all actions).
    • Operation Strategy: Include selected actions.
    NOTA:

    Selecting * may cause resources to be deleted. To avoid this risk, select Get* that indicates all read permissions.

    Conditions

    • Condition 1:
      • Condition Operator: DateGreaterThan
      • Key: CurrentTime
      • Value: 2019-03-26T12:00:00Z (UTC format)
    • Condition 2:
      • Condition Operator: DateLessThan
      • Key: CurrentTime
      • Value: 2019-03-26T15:00:00Z (UTC format)

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

Verification

During the specified time period, any user can access the specified resources in the bucket. Outside the specified time period, only the bucket owner can access the bucket.