forked from docs/doc-exports
Reviewed-by: Muller, Martin <martin.muller@t-systems.com> Co-authored-by: zhangyue <zhangyue164@huawei.com> Co-committed-by: zhangyue <zhangyue164@huawei.com>
61 lines
3.8 KiB
HTML
61 lines
3.8 KiB
HTML
<a name="sfs_01_0033"></a><a name="sfs_01_0033"></a>
|
|
|
|
<h1 class="topictitle1">Creating a Custom Policy</h1>
|
|
<div id="body1559035268440"><p id="sfs_01_0033__p88206116530">Custom policies can be created to supplement the system-defined policies of SFS. For the actions supported for custom policies, see section "Permissions Policies and Supported Actions" in the <em id="sfs_01_0033__i8883132710286">Scalable File Service API Reference</em>.</p>
|
|
<p id="sfs_01_0033__p2079563182513">You can create custom policies in either of the following two ways:</p>
|
|
<ul id="sfs_01_0033__ul379563122510"><li id="sfs_01_0033__li18795123142512">Visual editor: Select cloud services, actions, resources, and request conditions. This does not require knowledge of policy syntax.</li><li id="sfs_01_0033__li294510932511">JSON: Edit JSON policies from scratch or based on an existing policy.</li></ul>
|
|
<p id="sfs_01_0033__p8060118">This section provides examples of common custom SFS policies.</p>
|
|
<div class="section" id="sfs_01_0033__section2835114813515"><h4 class="sectiontitle">Example Custom Policies</h4><ul id="sfs_01_0033__ul536464619610"><li id="sfs_01_0033__li1364174616612">Example 1: Allowing users to create file systems<pre class="screen" id="sfs_01_0033__screen1368213551611">{
|
|
"Version": "1.1",
|
|
"Statement": [
|
|
{
|
|
"Action": [
|
|
"sfsturbo:shares:createShare"
|
|
],
|
|
"Effect": "Allow"
|
|
}
|
|
]
|
|
}</pre>
|
|
</li><li id="sfs_01_0033__li9519354109">Example 2: Denying file system deletion<p id="sfs_01_0033__p155835161014"><a name="sfs_01_0033__li9519354109"></a><a name="li9519354109"></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="sfs_01_0033__p1652035191014">The following method can be used if you need to assign permissions of the <strong id="sfs_01_0033__b84235270617319">SFS Turbo FullAccess</strong> policy to a user but also forbid the user from deleting file systems. Create a custom policy for denying file system deletion, and attach both policies to the group to which the user belongs. Then, the user can perform all operations on SFS except deleting file systems. The following is an example of a deny policy:</p>
|
|
<pre class="screen" id="sfs_01_0033__screen175143514107">{
|
|
"Version": "1.1",
|
|
"Statement": [
|
|
{
|
|
"Effect": "Deny",
|
|
"Action": [
|
|
"sfsturbo:shares:deleteShare"
|
|
]
|
|
}
|
|
]
|
|
}</pre>
|
|
</li><li id="sfs_01_0033__li636420461364">Example 3: Defining permissions for multiple services in a policy<p id="sfs_01_0033__p1212610243389"><a name="sfs_01_0033__li636420461364"></a><a name="li636420461364"></a>A custom policy can contain actions of multiple services that are all of the global or project-level type. The following is an example policy containing actions of multiple services:</p>
|
|
<pre class="screen" id="sfs_01_0033__screen1076416351481">{
|
|
"Version": "1.1",
|
|
"Statement": [
|
|
{
|
|
"Effect": "Allow",
|
|
"Action": [
|
|
"sfsturbo:shares:createShare",
|
|
"sfsturbo:shares:deleteShare",
|
|
"sfsturbo:shares:updateShare"
|
|
]
|
|
},
|
|
{
|
|
"Effect": "Allow",
|
|
"Action": [
|
|
"ecs:servers:delete"
|
|
]
|
|
}
|
|
]
|
|
}</pre>
|
|
</li></ul>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="sfs_01_0031.html">Permissions Management</a></div>
|
|
</div>
|
|
</div>
|
|
|