forked from laiweijian4/doc-exports
Reviewed-by: gtema <artem.goncharov@gmail.com> Co-authored-by: Jawei, Li <lijiawei5@huawei.com> Co-committed-by: Jawei, Li <lijiawei5@huawei.com>
261 lines
15 KiB
HTML
261 lines
15 KiB
HTML
<a name="obs_04_0030"></a><a name="obs_04_0030"></a>
|
|
|
|
<h1 class="topictitle1">Configuring a Bucket ACL</h1>
|
|
<div id="body5297011"><div class="section" id="obs_04_0030__section5584184924715"><h4 class="sectiontitle">Functions</h4><p id="obs_04_0030__p15018253">This operation controls access permissions for buckets. By default, only the creator of a bucket has the permission to read and write the bucket. You can also set other access permissions. For example, you can set a public read policy to grant the read permission to all users.</p>
|
|
<p id="obs_04_0030__p946549">You can configure an ACL when creating a bucket, and modify or obtain the ACLs of existing buckets using the API operations. A bucket ACL supports a maximum of 100 grants.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0030__section8518944"><h4 class="sectiontitle">Request Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0030__screen26404786"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9
|
|
10
|
|
11
|
|
12
|
|
13
|
|
14
|
|
15
|
|
16
|
|
17
|
|
18
|
|
19
|
|
20
|
|
21</pre></div></td><td class="code"><div class="highlight"><pre><span></span>PUT /?acl HTTP/1.1
|
|
Host: bucketname.obs.region.example.com
|
|
Date: date
|
|
Authorization: authorization
|
|
Content-Type: application/xml
|
|
Content-Length: length
|
|
|
|
<span class="nt"><AccessControlPolicy></span>
|
|
<span class="nt"><Owner></span>
|
|
<span class="nt"><ID></span>ID<span class="nt"></ID></span>
|
|
<span class="nt"></Owner></span>
|
|
<span class="nt"><AccessControlList></span>
|
|
<span class="nt"><Grant></span>
|
|
<span class="nt"><Grantee></span>
|
|
<span class="nt"><ID></span>domainId<span class="nt"></ID></span>
|
|
<span class="nt"></Grantee></span>
|
|
<span class="nt"><Permission></span>permission<span class="nt"></Permission></span>
|
|
<span class="nt"><Delivered></span>false<span class="nt"></Delivered></span>
|
|
<span class="nt"></Grant></span>
|
|
<span class="nt"></AccessControlList></span>
|
|
<span class="nt"></AccessControlPolicy></span>
|
|
</pre></div>
|
|
</td></tr></table></div>
|
|
</div>
|
|
<div class="section" id="obs_04_0030__section9561640"><h4 class="sectiontitle">Request Parameters</h4><p id="obs_04_0030__p3285080">This request contains no parameters.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0030__section18945901"><h4 class="sectiontitle">Request Headers</h4><p id="obs_04_0030__p64764894">You can change the ACL of a bucket by using the header settings. Each ACL configured with the header setting has a set of predefined grantees and authorized permissions. If you want to authorize access permissions by adding the header to a request, you must add the following header and specify the value.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0030__table46013138" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Optional header for specifying canned ACLs</caption><thead align="left"><tr id="obs_04_0030__row55711245"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.4.3.2.4.1.1"><p id="obs_04_0030__p16316966">Name</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.4.3.2.4.1.2"><p id="obs_04_0030__p46605831">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.4.3.2.4.1.3"><p id="obs_04_0030__p16975961">Mandatory</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="obs_04_0030__row32875587"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.3.2.4.1.1 "><p id="obs_04_0030__p45676910">x-obs-acl</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.3.2.4.1.2 "><p id="obs_04_0030__p8842242">Uses the canned ACL for a bucket.</p>
|
|
<p id="obs_04_0030__p45132965">Value options: <strong id="obs_04_0030__b1526321401416">private</strong> | <strong id="obs_04_0030__b13821617161417">public-read</strong> | <strong id="obs_04_0030__b1297122191412">public-read-write</strong> | <strong id="obs_04_0030__b424267141">public-read-delivered</strong> | <strong id="obs_04_0030__b5524531161411">public-read-write-delivered</strong></p>
|
|
<p id="obs_04_0030__p12471314">Type: string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.3.2.4.1.3 "><p id="obs_04_0030__p31891586">No</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0030__section36295384"><h4 class="sectiontitle">Request Elements</h4><p id="obs_04_0030__p33081663">This request carries ACL information in elements to specify an ACL. <a href="obs_04_0007.html#obs_04_0007__table25197309">Table 3</a> describes the elements.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0030__table62369028" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Additional request elements</caption><thead align="left"><tr id="obs_04_0030__row29679703"><th align="left" class="cellrowborder" valign="top" width="35.709999999999994%" id="mcps1.3.5.3.2.4.1.1"><p id="obs_04_0030__p55245705">Element</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="42.86%" id="mcps1.3.5.3.2.4.1.2"><p id="obs_04_0030__p8801047">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="21.43%" id="mcps1.3.5.3.2.4.1.3"><p id="obs_04_0030__p40621628">Mandatory</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="obs_04_0030__row18158267"><td class="cellrowborder" valign="top" width="35.709999999999994%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0030__p61533550">Owner</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.86%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0030__p18161633">Bucket owner information, including the ID</p>
|
|
<p id="obs_04_0030__p29236970">Type: XML</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0030__p19384352">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0030__row40241448"><td class="cellrowborder" valign="top" width="35.709999999999994%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0030__p38331852">ID</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.86%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0030__p17872337">Account ID of the authorized user</p>
|
|
<p id="obs_04_0030__p26633311">Type: string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0030__p9814616">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0030__row12128409"><td class="cellrowborder" valign="top" width="35.709999999999994%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0030__p42877090">Grant</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.86%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0030__p50492235">Container for the grantee and the granted permissions A single bucket ACL can contain no more than 100 grants.</p>
|
|
<p id="obs_04_0030__p51776931">Type: XML</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0030__p33181855">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0030__row30201246"><td class="cellrowborder" valign="top" width="35.709999999999994%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0030__p30381848">Grantee</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.86%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0030__p45010643">Grantee information</p>
|
|
<p id="obs_04_0030__p21983479">Type: XML</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0030__p35831338">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0030__row57331916125210"><td class="cellrowborder" valign="top" width="35.709999999999994%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0030__p373461620527">Canned</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.86%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0030__p916103775218">Grants permissions to all users.</p>
|
|
<p id="obs_04_0030__p121544984412">Value range: Everyone</p>
|
|
<p id="obs_04_0030__p19164637145219">Type: Enumeration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0030__p17361816115214">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0030__row181794203527"><td class="cellrowborder" valign="top" width="35.709999999999994%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0030__p1517952017528">Delivered</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.86%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0030__p417902025215">Indicates whether the bucket ACL is applied to all objects in the bucket.</p>
|
|
<p id="obs_04_0030__p4656194515534">Type: boolean The default value is <strong id="obs_04_0030__b84235270620428">false</strong>.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0030__p517912209528">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0030__row54046594"><td class="cellrowborder" valign="top" width="35.709999999999994%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0030__p15698002">Permission</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.86%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0030__p63578630">Permissions to be granted</p>
|
|
<p id="obs_04_0030__p5666973716">Value options: <strong id="obs_04_0030__b21510617337">READ</strong> | <strong id="obs_04_0030__b187551293331">WRITE</strong> | <strong id="obs_04_0030__b155738139333">FULL_CONTROL</strong></p>
|
|
<p id="obs_04_0030__p49595399">Type: Enumeration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0030__p57804348">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0030__row50477085"><td class="cellrowborder" valign="top" width="35.709999999999994%" headers="mcps1.3.5.3.2.4.1.1 "><p id="obs_04_0030__p62112124">AccessControlList</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.86%" headers="mcps1.3.5.3.2.4.1.2 "><p id="obs_04_0030__p65026180">Indicates an ACL, which consists of three elements: <strong id="obs_04_0030__b0267175152511">Grant</strong>, <strong id="obs_04_0030__b1060691252">Grantee</strong>, and <strong id="obs_04_0030__b7380121372517">Permission</strong>.</p>
|
|
<p id="obs_04_0030__p48364710">Type: XML</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.5.3.2.4.1.3 "><p id="obs_04_0030__p25227453">Yes</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0030__section58223002"><h4 class="sectiontitle">Response Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0030__screen30157841"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
|
|
2
|
|
3</pre></div></td><td class="code"><div class="highlight"><pre><span></span>HTTP/1.1 status_code
|
|
Date: date
|
|
Content-Length: length
|
|
</pre></div>
|
|
</td></tr></table></div>
|
|
</div>
|
|
<div class="section" id="obs_04_0030__section54244972"><h4 class="sectiontitle">Response Headers</h4><p class="msonormal" id="obs_04_0030__p1512332591013">The response to the request uses common headers. For details, see <a href="obs_04_0013.html#obs_04_0013__d0e686">Table 1</a>.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0030__section18442703"><h4 class="sectiontitle">Response Elements</h4><p id="obs_04_0030__p45135991">This response involves no elements.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0030__section31766605"><h4 class="sectiontitle">Error Responses</h4><p id="obs_04_0030__p32136637">No special error responses are returned. For details, see <a href="obs_04_0115.html#obs_04_0115__d0e843">Table 2</a>.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0030__section14482163815396"><h4 class="sectiontitle">Sample Request</h4><div class="codecoloring" codetype="Xml" id="obs_04_0030__screen8484163863919"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9
|
|
10
|
|
11
|
|
12
|
|
13
|
|
14
|
|
15
|
|
16
|
|
17
|
|
18
|
|
19
|
|
20
|
|
21
|
|
22
|
|
23
|
|
24
|
|
25
|
|
26
|
|
27
|
|
28
|
|
29
|
|
30
|
|
31
|
|
32
|
|
33
|
|
34</pre></div></td><td class="code"><div class="highlight"><pre><span></span>PUT /?acl HTTP/1.1
|
|
User-Agent: curl/7.29.0
|
|
Host: examplebucket.obs.region.example.com
|
|
Accept: */*
|
|
Date: WED, 01 Jul 2015 02:37:22 GMT
|
|
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:iqSPeUBl66PwXDApxjRKk6hlcN4=
|
|
Content-Length: 727
|
|
|
|
<span class="nt"><AccessControlPolicy</span> <span class="na">xmlns=</span><span class="s">"http://obs.example.com/doc/2015-06-30/"</span><span class="nt">></span>
|
|
<span class="nt"><Owner></span>
|
|
<span class="nt"><ID></span>b4bf1b36d9ca43d984fbcb9491b6fce9<span class="nt"></ID></span>
|
|
<span class="nt"></Owner></span>
|
|
<span class="nt"><AccessControlList></span>
|
|
<span class="nt"><Grant></span>
|
|
<span class="nt"><Grantee></span>
|
|
<span class="nt"><ID></span>b4bf1b36d9ca43d984fbcb9491b6fce9<span class="nt"></ID></span>
|
|
<span class="nt"></Grantee></span>
|
|
<span class="nt"><Permission></span>FULL_CONTROL<span class="nt"></Permission></span>
|
|
<span class="nt"></Grant></span>
|
|
<span class="nt"><Grant></span>
|
|
<span class="nt"><Grantee></span>
|
|
<span class="nt"><ID></span>783fc6652cf246c096ea836694f71855<span class="nt"></ID></span>
|
|
<span class="nt"></Grantee></span>
|
|
<span class="nt"><Permission></span>READ<span class="nt"></Permission></span>
|
|
<span class="nt"><Delivered></span>false<span class="nt"></Delivered></span>
|
|
<span class="nt"></Grant></span>
|
|
<span class="nt"><Grant></span>
|
|
<span class="nt"><Grantee></span>
|
|
<span class="nt"><Canned></span>Everyone<span class="nt"></Canned></span>
|
|
<span class="nt"></Grantee></span>
|
|
<span class="nt"><Permission></span>READ_ACP<span class="nt"></Permission></span>
|
|
<span class="nt"></Grant></span>
|
|
<span class="nt"></AccessControlList></span>
|
|
<span class="nt"></AccessControlPolicy></span>
|
|
</pre></div>
|
|
</td></tr></table></div>
|
|
</div>
|
|
<div class="section" id="obs_04_0030__section76081155815"><h4 class="sectiontitle">Sample Response</h4><div class="codecoloring" codetype="Xml" id="obs_04_0030__screen8485113814"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6</pre></div></td><td class="code"><div class="highlight"><pre><span></span>HTTP/1.1 200 OK
|
|
Server: OBS
|
|
x-obs-request-id: BF2600000164361F2954B4D063164704
|
|
x-obs-id-2: 32AAAQAAEAABSAAgAAEAABAAAQAAEAABCT78HTIBuhe0FbtSptrb/akwELtwyPKs
|
|
Date: WED, 01 Jul 2015 02:37:22 GMT
|
|
Content-Length: 0
|
|
</pre></div>
|
|
</td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_04_0026.html">Advanced Bucket Settings</a></div>
|
|
</div>
|
|
</div>
|
|
|