forked from docs/doc-exports
Reviewed-by: Rogal, Marcel <mrogal@noreply.gitea.eco.tsi-dev.otc-service.com> Co-authored-by: Wei, Hongmin <weihongmin1@huawei.com> Co-committed-by: Wei, Hongmin <weihongmin1@huawei.com>
8.1 KiB
8.1 KiB
Creating a Custom Policy
You can create custom policies to supplement system-defined policies and implement more refined access control.
Creating a Custom Policy in the Visual Editor
- On the IAM console, choose Policies in the navigation pane, and click Create Custom Policy.
- Enter a policy name.
- Select Visual editor.
- Set the policy content.
- Select Allow or Deny.
- Select a cloud service.
- Select actions.
- Select all resources, or select specific resources by specifying their paths.
- (Optional) Add request conditions by specifying condition keys, operators, and values.
Table 1 Condition parameters Name
Description
Condition Key
A key in the Condition element of a statement. There are global and service-level condition keys. Global condition keys (starting with g:) are available for operations of all services, while service-level condition keys (starting with a service abbreviation name such as obs:) are available only for operations of the corresponding service.
Operator
Used together with a condition key 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.
- (Optional) Switch to the JSON view and modify the policy content in the JSON format.
- (Optional) To add another permission block for the policy, click Add Permissions. Alternatively, click the plus (+) icon on the right of an existing permission block to clone its permissions.
- (Optional) Enter a brief description for the policy.
- Click OK.
- Attach the policy to a user group. Users in the group then inherit the permissions defined in the policy.
Creating a Custom Policy in JSON View
- On the IAM console, choose Policies in the navigation pane, and click Create Custom Policy.
- Enter a policy name.
- Select JSON.
- (Optional) Click Select Existing Policy, and select a policy to use it as a template, such as VPC Admin.
- Click OK.
- Modify the statement in the template.
- Effect: Set it to Allow or Deny.
- Action: Enter the actions provided in the API actions table of the EVS service, for example, evs:volumes:create.
- (Optional) Enter a brief description for the policy.
- Click OK. If the policy list is displayed, the policy is created successfully.
- Attach the policy to a user group. Users in the group then inherit the permissions defined in the policy.
Parent topic: Permissions