You are here

public static function S3CorsManagedFileHelper::getAcl in Flysystem - S3 8

Same name and namespace in other branches
  1. 2.0.x src/S3CorsManagedFileHelper.php \Drupal\flysystem_s3\S3CorsManagedFileHelper::getAcl()

Get the default S3 ACL setting for a file scheme.

Parameters

string $scheme: A file scheme.

Return value

string The S3 ACL upload setting. If not set in the scheme settings, it will default to 'private'.

1 call to S3CorsManagedFileHelper::getAcl()
S3CorsManagedFileHelper::preProcessCors in src/S3CorsManagedFileHelper.php
Function preProcessCors prepare the field to use CORS upload.

File

src/S3CorsManagedFileHelper.php, line 120

Class

S3CorsManagedFileHelper
Helper for altering and processing a managed_file element for CORS upload.

Namespace

Drupal\flysystem_s3

Code

public static function getAcl($scheme) {
  $settings = static::getSchemeSettings($scheme);

  // Config options is not required and ACL can be set to NULL to ignore
  // x-amz-acl header.
  if (!empty($settings['config']['options']) && array_key_exists('ACL', $settings['config']['options'])) {
    return $settings['config']['options']['ACL'];
  }
  return 'private';
}