python-boto3/docs/source/guide/s3-example-access-permissions.rst

32 lines
1.1 KiB
ReStructuredText
Raw Normal View History

2019-10-20 18:51:09 +02:00
.. Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2018-07-11 07:39:36 +02:00
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0
International License (the "License"). You may not use this file except in compliance with the
License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/.
This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific language governing permissions and
limitations under the License.
2019-10-20 18:51:09 +02:00
##################
2021-09-22 18:34:33 +02:00
Access permissions
2019-10-20 18:51:09 +02:00
##################
2018-07-11 07:39:36 +02:00
2019-10-20 18:51:09 +02:00
This section demonstrates how to manage the access permissions for an S3
bucket or object by using an access control list (ACL).
2018-07-11 07:39:36 +02:00
2021-09-22 18:34:33 +02:00
Get a bucket access control list
2019-10-20 18:51:09 +02:00
================================
2018-07-11 07:39:36 +02:00
2019-10-20 18:51:09 +02:00
The example retrieves the current access control list of an S3 bucket.
2018-07-11 07:39:36 +02:00
.. code-block:: python
import boto3
2019-10-20 18:51:09 +02:00
# Retrieve a bucket's ACL
2018-07-11 07:39:36 +02:00
s3 = boto3.client('s3')
result = s3.get_bucket_acl(Bucket='my-bucket')
print(result)