Commit ef0aa43d authored by Joe Hoyle's avatar Joe Hoyle Committed by GitHub
Browse files

Merge pull request #160 from philipowen/master

add control of S3 object permissions
parents e9775f60 defdccf0
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -154,6 +154,21 @@ S3 Uploads' URL rewriting feature can be disabled if the current website does no
define( 'S3_UPLOADS_DISABLE_REPLACE_UPLOAD_URL', true );
```

S3 Object Permissions
=======

The object permission of files uploaded to S3 by this plugin can be controlled by setting the `S3_UPLOADS_OBJECT_ACL`
constant. The default setting if not specified is `public-read` to allow objects to be read by anyone. If you don't
want the uploads to be publicly readable then you can define `S3_UPLOADS_OBJECT_ACL` as one of `private` or `authenticated-read` 
in you wp-config file:

```PHP
// Set the S3 object permission to private
define('S3_UPLOADS_OBJECT_ACL', 'private');
```

For more information on S3 permissions please see the Amazon S3 permissions documentation.

Offline Development
=======

+2 −1
Original line number Diff line number Diff line
@@ -73,7 +73,8 @@ class S3_Uploads {
			stream_wrapper_register( 's3', 'S3_Uploads_Local_Stream_Wrapper', STREAM_IS_URL );
		} else {
			S3_Uploads_Stream_Wrapper::register( $this->s3() );
			stream_context_set_option( stream_context_get_default(), 's3', 'ACL', 'public-read' );
			$objectAcl = defined( 'S3_UPLOADS_OBJECT_ACL' ) ? S3_UPLOADS_OBJECT_ACL : 'public-read';
			stream_context_set_option( stream_context_get_default(), 's3', 'ACL', $objectAcl );
		}

		stream_context_set_option( stream_context_get_default(), 's3', 'seekable', true );