You can create custom policies to supplement system-defined policies and implement more refined access control.
You can create custom policies in either of the following ways:
This section describes how to create custom policies on the Permissions > Policies/Roles page. You can also create custom policies during authorization (see Figure 1).
Figure 1 Creating a policy during authorization

Figure 2 Creating a custom policy

Figure 3 Entering a policy name

For example, when creating a custom policy containing the action evs:volumes:create for EVS, specify the scope as Project-level services.
A custom policy can contain actions of multiple services that are globally accessible or accessible through region-specific projects. To define permissions required to access both global and project-level services, create two custom policies and specify the scope as Global services and Project-level services respectively.
Parameter | Description |
|---|---|
Specific | Permissions for specific resources. For example, to define permissions for buckets whose names start with TestBucket, specify the bucket resource path as OBS:*:*:bucket:TestBucket*. NOTE:
Format: "OBS:*:*:bucket:Bucket name". For bucket resources, IAM automatically generates the prefix of the resource path: obs:*:*:bucket:. For the path of a specific bucket, add the bucket name to the end. You can also use a wildcard character (*) to indicate any bucket. For example, obs:*:*:bucket:* indicates any OBS bucket.
Format: "OBS:*:*:object:Bucket name/object name". For object resources, IAM automatically generates the prefix of the resource path: obs:*:*:object:. For the path of a specific object, add the bucket name/object name to the end of the resource path. You can also use a wildcard character (*) to indicate any object in a bucket. For example, obs:*:*:object:my-bucket/my-object/* indicates any object in the my-object directory of the my-bucket bucket. |
All | Permissions for all resources. |
Name | Description |
|---|---|
Condition Key | A key in the Condition element of a statement. There are global and service-specific condition keys. Global condition keys (starting with g:) are available for operations of all services, whereas service-specific condition keys (starting with a service abbreviation name such as obs:) are available only for operations of the corresponding service. For details, see the user guide of the corresponding cloud service. Condition keys are case insensitive. |
Operator | Used together with a condition key and condition value to form a complete condition statement. |
Value | Used together with a condition key and an operator that requires a keyword, to form a complete condition statement. |
Figure 4 Adding a request condition

Global Condition Key | Type | Description |
|---|---|---|
g:CurrentTime | Time | Time when an authentication request is received. The time is in ISO 8601 format, for example, 2012-11-11T23:59:59Z. |
g:DomainName | String | Account name. |
g:MFAPresent | Boolean | Whether to obtain a token through MFA authentication. |
g:MFAAge | Number | Validity period of a token obtained through MFA authentication. This condition must be used together with g:MFAPresent. |
g:ProjectName | String | Project name. |
g:UserId | String | IAM user ID. |
g:UserName | String | IAM username. |
If the modified policy content is incorrect, check and modify the content again, or click Reset to cancel the modifications.
You can attach custom policies to a user group in the same way as you attach system-defined policies. For details, see Creating a User Group and Assigning Permissions.
Figure 5 Creating a custom policy

Figure 6 Entering a policy name

For example, when creating a custom policy containing the action evs:volumes:create for EVS, specify the scope as Project-level services.
A custom policy can contain actions of multiple services that are globally accessible or accessible through region-specific projects. To define permissions required to access both global and project-level services, create two custom policies and specify the scope as Global services and Project-level services respectively.
If you select multiple policies, all of them must have the same scope, that is, either Global services or Project-level services. To define permissions required to access both global and project-level services, enclose the permissions in two separate custom policies for refined authorization.
Figure 7 API actions

The version of each custom policy is fixed at 1.1.
You can attach custom policies to a user group in the same way as you attach system-defined policies. For details, see Creating a User Group and Assigning Permissions.