Files
doc-exports/docs/vpc/umn/permission_0004.html
Qin Ying, Fan 19f0993a37 VPC UMN 20231207 version
Reviewed-by: Sarda, Priya <prsarda@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-authored-by: Qin Ying, Fan <fanqinying@huawei.com>
Co-committed-by: Qin Ying, Fan <fanqinying@huawei.com>
2023-12-20 11:27:38 +00:00

64 lines
4.0 KiB
HTML

<a name="permission_0004"></a><a name="permission_0004"></a>
<h1 class="topictitle1">VPC Custom Policies</h1>
<div id="body1558602290736"><p id="permission_0004__p624113263018">Custom policies can be created to supplement the system-defined policies of VPC. For the actions supported for custom policies, see <a href="https://docs.otc.t-systems.com/virtual-private-cloud/api-ref/permissions_policies_and_supported_actions/index.html" target="_blank" rel="noopener noreferrer">Permissions Policies and Supported Actions</a>.</p>
<p id="permission_0004__p1391019913815">You can create custom policies in either of the following ways:</p>
<ul id="permission_0004__ul1146431393818"><li id="permission_0004__li5764181518386">Visual editor: Select cloud services, actions, resources, and request conditions. This does not require knowledge of policy syntax.</li><li id="permission_0004__li546410135389">JSON: Edit JSON policies from scratch or based on an existing policy.</li></ul>
<p id="permission_0004__p14439125933520">For operation details, see <a href="https://docs.otc.t-systems.com/identity-access-management/umn/user_guide/permissions/creating_a_custom_policy.html" target="_blank" rel="noopener noreferrer">Creating a Custom Policy</a>. The following section contains examples of common VPC custom policies.</p>
<div class="section" id="permission_0004__section51981826152017"><h4 class="sectiontitle">Example Custom Policies</h4><ul id="permission_0004__ul783572752011"><li id="permission_0004__li14835327172017">Example 1: Allowing users to create and view VPCs<pre class="screen" id="permission_0004__screen1464193292417">{
"Version": "1.1",
"Statement": [
{
"Effect": "Allow",
"Action": [
"
vpc:vpcs:create
vpc:vpcs:list
"
]
}
]
}</pre>
</li><li id="permission_0004__li1083502772018">Example 2: Denying VPC deletion<p id="permission_0004__p11835122732018"><a name="permission_0004__li1083502772018"></a><a name="li1083502772018"></a>A deny policy 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.</p>
<p id="permission_0004__p16835182716203">The following method can be used if you need to assign permissions of the <strong id="permission_0004__b549118181508">VPC FullAccess</strong> policy to a user but also forbid the user from deleting VPCs. Create a custom policy for denying VPC deletion, and assign both policies to the group the user belongs to. Then the user can perform all operations on VPC except deleting VPCs. The following is an example deny policy:</p>
<pre class="screen" id="permission_0004__screen0212155773014">{
"Version": "1.1",
"Statement": [
{
"Effect": "Deny",
"Action": [
"vpc:vpcs:delete"
]
}
]
}</pre>
</li><li id="permission_0004__li53625446377">Example 3: Defining permissions for multiple services in a policy<p id="permission_0004__p2610194519379"><a name="permission_0004__li53625446377"></a><a name="li53625446377"></a>A custom policy can contain the actions of multiple services that are of the global or project-level type. The following is an example policy containing actions of multiple services:</p>
<pre class="screen" id="permission_0004__screen198174024711">{
"Version": "1.1",
"Statement": [
{
"Action": [
"vpc:vpcs:create",
"vpc:vpcs:update"
],
"Effect": "Allow"
},
{
"Action": [
"ecs:servers:delete"
],
"Effect": "Allow"
}
]
}</pre>
<p id="permission_0004__p869325211462"></p>
</li></ul>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="permission_0001.html">Permissions Management</a></div>
</div>
</div>