forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Chen, Junjie <chenjunjie@huawei.com> Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
46 lines
3.9 KiB
HTML
46 lines
3.9 KiB
HTML
<a name="apig-custom-policy"></a><a name="apig-custom-policy"></a>
|
|
|
|
<h1 class="topictitle1">APIG Custom Policies</h1>
|
|
<div id="body1585035631993"><p id="apig-custom-policy__en-us_topic_0232979206_p958317321214">Custom policies can be created to supplement the system-defined policies of APIG. For the actions that can be added to custom policies, see section "Permissions Policies and Supported Actions" in the <em id="apig-custom-policy__i10321123255714">API Gateway API Reference</em>.</p>
|
|
<p id="apig-custom-policy__en-us_topic_0232979206_p11763528201217">You can create custom policies using one of the following methods:</p>
|
|
<ul id="apig-custom-policy__en-us_topic_0232979206_ul87631028191213"><li id="apig-custom-policy__en-us_topic_0232979206_li176382821219">Visual editor: Select cloud services, actions, resources, and request conditions. This does not require knowledge of policy syntax.</li><li id="apig-custom-policy__en-us_topic_0232979206_li1776320280124">JSON: Edit JSON policies from scratch or based on an existing policy.</li></ul>
|
|
<p id="apig-custom-policy__en-us_topic_0232979206_p38310456104">For details, see section "Creating a Custom Policy" in the <em id="apig-custom-policy__i143671496574">Identity and Access Management User Guide</em>. The following section contains examples of common APIG custom policies.</p>
|
|
<div class="note" id="apig-custom-policy__en-us_topic_0232979206_note416314130244"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="apig-custom-policy__en-us_topic_0232979206_p16164181311242">Only dedicated API gateways support system-defined policies and custom policies.</p>
|
|
</div></div>
|
|
<div class="section" id="apig-custom-policy__en-us_topic_0232979206_section207947385117"><h4 class="sectiontitle">Example Custom Policies</h4><ul id="apig-custom-policy__en-us_topic_0232979206_ul1379473816114"><li id="apig-custom-policy__en-us_topic_0232979206_li1679416383118">Example 1: Allow users to create and debug APIs<pre class="screen" id="apig-custom-policy__en-us_topic_0232979206_screen15794193891113">{
|
|
"Version": "1.1",
|
|
"Statement": [
|
|
{
|
|
"Effect": "Allow",
|
|
"Action": [
|
|
"
|
|
apig:apis:create
|
|
apig:apis:debug
|
|
"
|
|
]
|
|
}
|
|
]
|
|
}</pre>
|
|
</li><li id="apig-custom-policy__en-us_topic_0232979206_li87948384116">Example 2: Deny API group creation<p id="apig-custom-policy__en-us_topic_0232979206_p079415386115"><a name="apig-custom-policy__en-us_topic_0232979206_li87948384116"></a><a name="en-us_topic_0232979206_li87948384116"></a>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", the "Deny" permissions take precedence over the "Allow" permissions.</p>
|
|
<p id="apig-custom-policy__en-us_topic_0232979206_p47946388118">The following method can be used if you need to assign permissions of the <strong id="apig-custom-policy__en-us_topic_0232979206_b6582529173710">APIG FullAccess</strong> policy to a user but you want to prevent the user from creating API groups. Create a custom policy for denying API group creation, and attach both policies to the group to which the user belongs. Then, the user can perform all operations on API gateways except creating API groups. The following is an example of a deny policy:</p>
|
|
<pre class="screen" id="apig-custom-policy__en-us_topic_0232979206_screen14794038181119">{
|
|
"Version": "1.1",
|
|
"Statement": [
|
|
{
|
|
"Effect": "Deny",
|
|
"Action": [
|
|
"apig:groups:create"
|
|
]
|
|
}
|
|
]
|
|
}</pre>
|
|
</li></ul>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="apig-ug-190529107.html">Permissions Management</a></div>
|
|
</div>
|
|
</div>
|
|
|