forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Jawei, Li <lijiawei5@huawei.com> Co-committed-by: Jawei, Li <lijiawei5@huawei.com>
203 lines
14 KiB
HTML
203 lines
14 KiB
HTML
<a name="EN-US_TOPIC_0125560460"></a><a name="EN-US_TOPIC_0125560460"></a>
|
|
|
|
<h1 class="topictitle1">PUT Object acl</h1>
|
|
<div id="body1234623"><p id="EN-US_TOPIC_0125560460__p1068911071219">You can use this operation to modify an object ACL.</p>
|
|
<p id="EN-US_TOPIC_0125560460__p64491538">OBS allows you to control access permission for objects. By default, only an object creator can access the object. However, the creator can set an access policy (such as a public access policy) to grant <strong id="EN-US_TOPIC_0125560460__b11111615">READ</strong> permission for the object to other users. For the object in SSE-KMS model, it does not take effect.</p>
|
|
<p id="EN-US_TOPIC_0125560460__p43552930">You can set an access control policy when uploading an object or send <strong id="EN-US_TOPIC_0125560460__b32895671">PUT Object acl</strong> or <strong id="EN-US_TOPIC_0125560460__b142312533153">GET Object acl</strong> request to modify or obtain the object ACL.</p>
|
|
<div class="section" id="EN-US_TOPIC_0125560460__section56432055"><h4 class="sectiontitle">Versioning</h4><p id="EN-US_TOPIC_0125560460__p6392767">By default, this operation modifies the ACL of an object of the latest version. You can specify <strong id="EN-US_TOPIC_0125560460__b57534908">versionId</strong> to modify the ACL of an object of the desired version.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560460__section4767735"><h4 class="sectiontitle">Request Syntax</h4><pre class="screen" id="EN-US_TOPIC_0125560460__screen17763563113629">PUT /ObjectName?acl HTTP/1.1
|
|
User-Agent: agent
|
|
Host: bucketname.obs.example.com
|
|
Accept: */*
|
|
Date: date
|
|
Authorization: authorization
|
|
Content-Length: length
|
|
Expect: expect
|
|
|
|
<AccessControlPolicy>
|
|
<Owner>
|
|
<ID>ID</ID>
|
|
<DisplayName>displayname</DisplayName>
|
|
</Owner>
|
|
<AccessControlList>
|
|
<Grant>
|
|
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">grantee</Grantee>
|
|
<Permission>permission</Permission>
|
|
</Grant>
|
|
</AccessControlList>
|
|
</AccessControlPolicy></pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560460__section42909617"><h4 class="sectiontitle">Request Parameters</h4><p id="EN-US_TOPIC_0125560460__p15578220"><a href="#EN-US_TOPIC_0125560460__table48052128">Table 1</a> describes the request parameter.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0125560460__table48052128"></a><a name="table48052128"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0125560460__table48052128" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request parameter</caption><thead align="left"><tr id="EN-US_TOPIC_0125560460__row53988209"><th align="left" class="cellrowborder" valign="top" width="25.47254725472547%" id="mcps1.3.6.3.2.4.1.1"><p id="EN-US_TOPIC_0125560460__p10968783">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="49.85498549854985%" id="mcps1.3.6.3.2.4.1.2"><p id="EN-US_TOPIC_0125560460__p16056197">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="24.672467246724672%" id="mcps1.3.6.3.2.4.1.3"><p id="EN-US_TOPIC_0125560460__p25483580">Remarks</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0125560460__row28025631"><td class="cellrowborder" valign="top" width="25.47254725472547%" headers="mcps1.3.6.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560460__p55483642">versionId</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="49.85498549854985%" headers="mcps1.3.6.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560460__p64989993">Indicates the version ID of an object. The ACL of the object with the version ID specified by this parameter is modified.</p>
|
|
<p id="EN-US_TOPIC_0125560460__p48039028">Type: String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="24.672467246724672%" headers="mcps1.3.6.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560460__p65956029">Optional</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560460__section50642235"><h4 class="sectiontitle">Request Headers</h4><p id="EN-US_TOPIC_0125560460__p31998529">This request uses common headers. For details about common request headers, see section <a href="en-us_topic_0125560462.html">Common Request Headers</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560460__section53126934"><h4 class="sectiontitle">Request Elements</h4><p id="EN-US_TOPIC_0125560460__p25827520">This request contains elements to specify the ACL. <a href="#EN-US_TOPIC_0125560460__table6365150">Table 2</a> describes the elements.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0125560460__table6365150"></a><a name="table6365150"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0125560460__table6365150" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request elements</caption><thead align="left"><tr id="EN-US_TOPIC_0125560460__row2102614"><th align="left" class="cellrowborder" valign="top" width="25.47254725472547%" id="mcps1.3.8.3.2.4.1.1"><p id="EN-US_TOPIC_0125560460__p36094027">Element</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="48.57485748574857%" id="mcps1.3.8.3.2.4.1.2"><p id="EN-US_TOPIC_0125560460__p37935089">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25.95259525952595%" id="mcps1.3.8.3.2.4.1.3"><p id="EN-US_TOPIC_0125560460__p52843375">Remarks</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0125560460__row52455022"><td class="cellrowborder" valign="top" width="25.47254725472547%" headers="mcps1.3.8.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560460__p20998422">ID</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="48.57485748574857%" headers="mcps1.3.8.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560460__p23150606">DomainId of the user.</p>
|
|
<p id="EN-US_TOPIC_0125560460__p7028863">Type: String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25.95259525952595%" headers="mcps1.3.8.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560460__p32467059">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560460__row23768079"><td class="cellrowborder" valign="top" width="25.47254725472547%" headers="mcps1.3.8.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560460__p46166248">DisplayName</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="48.57485748574857%" headers="mcps1.3.8.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560460__p48478642">Indicates the user name.</p>
|
|
<p id="EN-US_TOPIC_0125560460__p33654601">Type: String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25.95259525952595%" headers="mcps1.3.8.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560460__p41668159">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560460__row39469112"><td class="cellrowborder" valign="top" width="25.47254725472547%" headers="mcps1.3.8.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560460__p42881475">Permission</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="48.57485748574857%" headers="mcps1.3.8.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560460__p50847455">Indicates the permission to be granted.</p>
|
|
<p id="EN-US_TOPIC_0125560460__p54973915">Type: Enumeration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25.95259525952595%" headers="mcps1.3.8.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560460__p23702098">Optional</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560460__section7458393"><h4 class="sectiontitle">Response Syntax</h4><pre class="screen" id="EN-US_TOPIC_0125560460__screen4280368113651">HTTP/1.1 status_code
|
|
Server: Server Name
|
|
x-amz-request-id: request id
|
|
x-amz-id-2: id
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
|
|
Date: date
|
|
Content-Length: length </pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560460__section16677"><h4 class="sectiontitle">Response Headers</h4><p id="EN-US_TOPIC_0125560460__p9613768">This response uses common headers. For details about common response headers, see section <a href="en-us_topic_0125560484.html">Common Response Headers</a>.</p>
|
|
<p id="EN-US_TOPIC_0125560460__p29115678">This response also uses one optional header, as described in <a href="#EN-US_TOPIC_0125560460__table40821806">Table 3</a>.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0125560460__table40821806"></a><a name="table40821806"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0125560460__table40821806" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Optional response header</caption><thead align="left"><tr id="EN-US_TOPIC_0125560460__row65951706"><th align="left" class="cellrowborder" valign="top" width="29.5%" id="mcps1.3.10.4.2.3.1.1"><p id="EN-US_TOPIC_0125560460__p40487987">Header</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="70.5%" id="mcps1.3.10.4.2.3.1.2"><p id="EN-US_TOPIC_0125560460__p58301484">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0125560460__row24799725"><td class="cellrowborder" valign="top" width="29.5%" headers="mcps1.3.10.4.2.3.1.1 "><p id="EN-US_TOPIC_0125560460__p62620703">x-amz-version-id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="70.5%" headers="mcps1.3.10.4.2.3.1.2 "><p id="EN-US_TOPIC_0125560460__p39112169">Indicates the version ID of the object whose ACL is modified.</p>
|
|
<p id="EN-US_TOPIC_0125560460__p16465207">Type: String</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560460__section150098"><h4 class="sectiontitle">Response Elements</h4><p id="EN-US_TOPIC_0125560460__p57758568">This response involves no elements.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560460__section1350890"><h4 class="sectiontitle">Error Responses</h4><p id="EN-US_TOPIC_0125560460__p47932395">No special error responses are returned. For details about error responses, see <a href="en-us_topic_0125560440.html#EN-US_TOPIC_0125560440__table30733758">Table 1</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560460__section52175844"><h4 class="sectiontitle">Sample Request</h4><pre class="screen" id="EN-US_TOPIC_0125560460__screen15076348113721">PUT /test?acl HTTP/1.1
|
|
User-Agent: Jakarta Commons-HttpClient/3.1
|
|
Host: bucketname.obs.example.com
|
|
Accept: */*
|
|
Date: Mon, 27 Sep 2010 02:00:40 GMT
|
|
Authorization: AWS 04RZT432N80TGDF2Y2G2:vktmLfCDhy0XbJw2T2mhNM9PZ70=
|
|
Content-Length: 916
|
|
Expect: 100-continue
|
|
|
|
<AccessControlPolicy>
|
|
<Owner>
|
|
<ID>bcaf1ffd86f41caff1a493dc2ad8c2c281e37522a640e161ca5fb16fd081034f</ID>
|
|
<DisplayName>user</DisplayName>
|
|
</Owner>
|
|
<AccessControlList>
|
|
<Grant>
|
|
<Grantee xsi:type="CanonicalUser" xmlns:xsi="http:// www.w3.org/2001/XMLSchema-instance"> <ID>bcaf1ffd86f41caff1a493dc2ad8c2c281e37522a640e161ca5fb16fd081034f</ID>
|
|
<DisplayName>user</DisplayName>
|
|
</Grantee>
|
|
<Permission>READ</Permission>
|
|
</Grant>
|
|
<Grant>
|
|
<Grantee xsi:type="CanonicalUser" xmlns:xsi="http:// www.w3.org/2001/XMLSchema-instance"> <ID>bcaf1ffd86f41caff1a493dc8c2c281e37522a640e161ca5fb16fd081034f</ID>
|
|
<DisplayName>user</DisplayName>
|
|
</Grantee>
|
|
<Permission>WRITE</Permission>
|
|
</Grant>
|
|
</AccessControlList>
|
|
</AccessControlPolicy></pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560460__section66929418"><h4 class="sectiontitle">Sample Response</h4><pre class="screen" id="EN-US_TOPIC_0125560460__screen29843892113733">HTTP/1.1 200 OK
|
|
Server: OBS
|
|
x-amz-request-id: 5FBCAEB7BB9A1AD0FF1285553243654
|
|
x-amz-id-2: NUZCQ0FFQjdCQjlBMUFEMEZGMTI4NTU1MzI0MzY1NEFBQUFBQUFBYmJiYmJiYmJD
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
|
|
Date: Mon, 27 Sep 2010 02:07:23 GMT
|
|
Content-Length: 0</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560460__section52573766"><h4 class="sectiontitle">Sample Request (Setting the ACL of an Object with Version ID Specified)</h4><pre class="screen" id="EN-US_TOPIC_0125560460__screen14379610113746">PUT /object?acl&versionId=AAABQ47OMnbc0vycq3gAAAANVURTRkha HTTP/1.1
|
|
User-Agent: Jakarta Commons-HttpClient/3.1
|
|
Host: bucketname.obs.example.com
|
|
Accept: */*
|
|
Date: Tue, 14 Jan 2014 05:39:29 +0000
|
|
Authorization: AWS C9590CEB8EC051BDEC9D:PrLaB1TR7ok53Oui4jImSpWbcik=
|
|
Content-Length: 504
|
|
Expect: 100-continue
|
|
|
|
<AccessControlPolicy xmlns="http://obs.example.com/doc/2015-06-30/">
|
|
<Owner>
|
|
<ID>DCD2FC9CAB78000001438EC051BD0002</ID>
|
|
<DisplayName>user</DisplayName>
|
|
</Owner>
|
|
<AccessControlList>
|
|
<Grant>
|
|
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
|
|
<ID>DCD2FC9CAB78000001438EC051BD0002</ID>
|
|
<DisplayName>user</DisplayName>
|
|
</Grantee>
|
|
<Permission>READ</Permission>
|
|
</Grant>
|
|
</AccessControlList>
|
|
</AccessControlPolicy></pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560460__section3401846"><h4 class="sectiontitle">Sample Response (Setting the ACL of an Object with Version ID Specified)</h4><pre class="screen" id="EN-US_TOPIC_0125560460__screen21479649113756">HTTP/1.1 200 OK
|
|
Server: OBS
|
|
x-amz-request-id: 5FBCAEB7BB9A1AD0FF1285553243654
|
|
x-amz-id-2: NUZCQ0FFQjdCQjlBMUFEMEZGMTI4NTU1MzI0MzY1NEFBQUFBQUFBYmJiYmJiYmJD
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
|
|
x-amz-version-id: AAABQ47OMnbc0vycq3gAAAANVURTRkha
|
|
Date: Mon, 27 Sep 2010 02:07:23 GMT
|
|
Content-Length: 0</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0125560489.html">Operations on Objects</a></div>
|
|
</div>
|
|
</div>
|
|
|