Creating a Custom Policy
Custom policies can be created to supplement the system-defined policies of CDN.
You can create custom policies in either of the following two ways:
- Visual editor: Select cloud services, actions, resources, and request conditions without the need to know policy syntax.
- JSON: Edit JSON policies from scratch or based on an existing policy.
This section provides examples of common custom CCE policies.
Example Custom Policies
- Example 1: Allowing users to create acceleration domain names
{ "Version": "1.1", "Statement": [ { "Effect": "Allow", "Action": [ "cdn:configuration:createDomains" ] } ] }
- Example 2: Allowing users to set an IP blacklist
{ "Version": "1.1", "Statement": [ { "Action": [ "cdn:configuration:modifyIpAcl" ], "Effect": "Allow" } ] }
- Example 3: Denying users to delete acceleration domain names.
A policy with only "Deny" permissions must be used in conjunction with other policies to take effect. If the permissions assigned to a user contain both Allow and Deny actions, the Deny actions take precedence over the Allow actions.
The following method can be used if you need to assign permissions of the CDN Admin policy to a user but also forbid the user from deleting acceleration domain names. Create a custom policy for denying acceleration domain name deletion, and assign both policies to the group the user belongs to. Then the user can perform all operations on CDN except deleting acceleration domain names. The following is an example deny policy:
{ "Version": "1.1", "Statement": [ { "Action": [ "cdn:configuration:deleteDomains" ], "Effect": "Deny" } ] }
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.