returns a bucket's acl
343941
def get_acl(self, validate=True, headers=None, version_id=None):
        """"""
        if not self.bucket_name:
            raise InvalidUriError('get_acl on bucket-less URI (%s)' % self.uri)
        bucket = self.get_bucket(validate, headers)
        # This works for both bucket- and object- level ACLs (former passes
        # key_name=None):
        acl = bucket.get_acl(self.object_name, headers, version_id)
        self.check_response(acl, 'acl', self.uri)
        return acl
525841
def get_bucket_location(self, bucket):
        
        details = self._details(
            method=b"GET",
            url_context=self._url_context(bucket=bucket, object_name="?location"),
        )
        d = self._submit(self._query_factory(details))
        d.addCallback(self._parse_bucket_location)
        return d
358064
def get_acls_recursive(self, path, depth, include_ephemerals):
        
        yield path, self.get_acls(path)[0]

        if depth == -1:
            return

        for tpath, _ in self.tree(path, depth, full_path=True):
            try:
                acls, stat = self.get_acls(tpath)
            except NoNodeError:
                continue

            if not include_ephemerals and stat.ephemeralOwner != 0:
                continue

            yield tpath, acls
427024
public function createBucket(string $bucket, string $acl = OssClient::OSS_ACL_TYPE_PRIVATE)
    {
        try {
            $this->client->createBucket($bucket, $acl);
            return $this->success('创建Bucket成功');
        } catch (\Exception $exception) {
            return $this->error('调用阿里云接口出错：' . $exception->getMessage());
        }
    }
498459
function bucketAccessible(s3, bucketName) {
  return new Promise(function(resolve, reject) {
    var params = {
      Bucket: bucketName
    };
    s3.headBucket(params, function(err, data) {
      if (err) {
        reject(new VError(err, 'S3 bucket not accessible'));
      } else {
        resolve();
      }
    });
  });
}
838401
function(acl) {
                var args = {
                    url: this.buildUri(this.type, this.id),
                    method: corbel.request.method.PUT,
                    data: acl,
                    Accept: 'application/corbel.acl+json'
                };

                return this.request(args);
            }
1313715
def get_bucket_policy(self, bucket_name):
        
        is_valid_bucket_name(bucket_name)

        response = self._url_open("GET",
                                  bucket_name=bucket_name,
                                  query={"policy": ""})
        return response.data
162346
def set_canned_acl(self, acl_str, validate=True, headers=None,
                       version_id=None):
        """"""
        if not self.object_name:
            raise InvalidUriError('set_canned_acl on object-less URI (%s)' %
                                  self.uri)
        key = self.get_key(validate, headers)
        self.check_response(key, 'key', self.uri)
        key.set_canned_acl(acl_str, headers, version_id)
839070
def set_acl(self, acl_or_str, key_name='', validate=True, headers=None,
                version_id=None):
        """"""
        if not self.bucket_name:
            raise InvalidUriError('set_acl on bucket-less URI (%s)' %
                                  self.uri)
        self.get_bucket(validate, headers).set_acl(acl_or_str, key_name,
                                                   headers, version_id)
154605
def __get_acl(self, load):
        '''
        
        '''
        if 'eauth' not in load:
            return None
        mod = self.opts['eauth_acl_module']
        if not mod:
            mod = load['eauth']
        fstr = '{0}.acl'.format(mod)
        if fstr not in self.auth:
            return None
        fcall = salt.utils.args.format_call(
            self.auth[fstr],
            load,
            expected_extra_kws=AUTH_INTERNAL_KEYWORDS)
        try:
            return self.auth[fstr](*fcall['args'], **fcall['kwargs'])
        except Exception as e:
            log.debug('Authentication module threw %s', e)
            return None
436805
def url(self):
        """"""
        if self.is_public:
            return '{0}/{1}/{2}'.format(
                self.bucket._boto_s3.meta.client.meta.endpoint_url,
                self.bucket.name,
                self.name
            )
        else:
            raise ValueError('{0!r} does not have the public-read ACL set. '
                             'Use the make_public() method to allow for '
                             'public URL sharing.'.format(self.name))
555981
def item_acl(self, item):
        
        if self.es_based:
            from nefertari_guards.elasticsearch import get_es_item_acl
            return get_es_item_acl(item)
        return super(DatabaseACLMixin, self).item_acl(item)
1301203
public function putBucketAcl($bucket, $acl)
    {
        $params = [
            'Bucket' => $bucket,
            'Acl'    => $acl
        ];

        return $this->instance->putBucketAcl($params);
    }
1015484
public static function setObjectACL($key, $bucket, $acl = 'public-read')
    {
        $s3c = self::getS3C();
        if ($s3c->doesObjectExist($bucket, $key)) {
            $result = $s3c->putObjectAcl(array(
                'ACL' => $acl,
                'Bucket' => $bucket,
                'Key' => $key,
            ));
            if ($result) {
                return true;
            }
        }

        return false;
    }
1352667
def path(self, name):
        
        if not name:
            raise SuspiciousOperation("Attempted access to '%s' denied." % name)
        return os.path.join(self._bucket, name)
1107812
def _compare_acl(current, desired, region, key, keyid, profile):
    '''
    
    '''
    ocid = _get_canonical_id(region, key, keyid, profile)
    return __utils__['boto3.json_objs_equal'](current, _acl_to_grant(desired, ocid))
682730
public Bucket getBucketPolicyOnly(String bucketName) throws StorageException {
    // [START storage_get_bucket_policy_only]
    // Instantiate a Google Cloud Storage client
    Storage storage = StorageOptions.getDefaultInstance().getService();

    // The name of a bucket, e.g. "my-bucket"
    // String bucketName = "my-bucket";

    Bucket bucket = storage.get(bucketName, BucketGetOption.fields(BucketField.IAMCONFIGURATION));
    BucketInfo.IamConfiguration iamConfiguration = bucket.getIamConfiguration();

    Boolean enabled = iamConfiguration.isBucketPolicyOnlyEnabled();
    Date lockedTime = new Date(iamConfiguration.getBucketPolicyOnlyLockedTime());

    if (enabled != null && enabled) {
      System.out.println("Bucket Policy Only is enabled for " + bucketName);
      System.out.println("Bucket will be locked on " + lockedTime);
    } else {
      System.out.println("Bucket Policy Only is disabled for " + bucketName);
    }
    // [END storage_get_bucket_policy_only]
    return bucket;
  }