This topic describes how to implement data sharing across different departments or projects of an enterprise so that the data shared by a department can be only downloaded but cannot be written or deleted by users of other departments. This reduces the risk of accidental deletion and modification of the shared data.
Background information
In this example, Department A shares the data stored in a bucket named example-bucket with users of Department B and allows these users to download the shared data. This example shows how to follow the principle of least privilege to control access to shared data. The following figure shows the relationship between the shared bucket and the administrators and users of Department A and Department B.

Procedure
In this example, the administrator of Department A can configure bucket policies to allow users of Department B to download but not write or delete the shared data. To achieve the goal, the following steps must be performed:
- Step 1: Create a bucket
The administrator of Department A creates a bucket named example-bucket to store shared data.
- Step 2: Grant permissions to upload shared data
The administrator of Department A configures a bucket policy for example-bucket to allow users of Department A to upload shared data to the bucket.
- Step 3: Grant permissions to download but not write or delete shared data
The administrator of Department A configures a bucket policy for example-bucket to allow users of Department B to download but not write or delete shared data.
- Step 4: Upload shared data
Users of Department A upload shared data to example-bucket.
- Step 5: Verify permissions
Verify the permissions of the users of Department B to ensure that they can only download but cannot write or delete shared data.
Prerequisites
- RAM users for the administrators and users of Department A and Department B are created
by the Alibaba Cloud account of the enterprise.
For more information about how to create RAM users, see Create a RAM user.
- The UIDs of the RAM users are obtained.
For more information about how to view the basic information about a RAM user such as the UID, see View the basic information about a RAM user.
- Appropriate permissions are granted to the RAM users.
In this example, the administrator of Department A needs to create buckets and configure bucket policies. Therefore, the RAM user group of the administrator must have the AliyunOSSFullAccess permission. For more information about how to grant permissions to RAM users, see Grant permissions to the RAM user.
Step 1: Create a bucket
Perform the following steps to create a bucket in the China (Hangzhou) region as the administrator of Department A:
Step 2: Grant permissions to upload shared data
Perform the following steps to grant users of Department A permissions to upload shared data to example-bucket as the administrator of Department A:
Step 3: Grant permissions to download but not write or delete shared data
Perform the following steps to grant users of Department B permissions to download shared data from example-bucket as the administrator of Department A:
Step 4: Upload shared data
Perform the following steps to upload data to example-bucket as a user of Department A:
Step 5: Verify permissions
Perform the following steps in the OSS console to verify that users of Department B can only download but cannot write or delete shared data:
- Log on to the OSS console as a RAM user of Department B.
- Go to the Files panel by using the following URL:
https://oss.console.aliyun.com/bucket/hangzhou/example-bucket/object
. - In the Files panel, verify the following permissions: