Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add option s3_acl_enabled #92

Merged
merged 2 commits into from
Sep 18, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/paperclip/storage/s3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def self.extended(base)
base.instance_eval do
@s3_options = @options[:s3_options] || {}
@s3_permissions = set_permissions(@options[:s3_permissions])
@s3_acl_enabled = @options[:s3_acl_enabled] || true
everpcpc marked this conversation as resolved.
Show resolved Hide resolved
@s3_protocol = @options[:s3_protocol] || ""
@s3_metadata = @options[:s3_metadata] || {}
@s3_headers = {}
Expand Down Expand Up @@ -359,9 +360,12 @@ def flush_writes #:nodoc:
log("saving #{path(style)}")
write_options = {
content_type: file.content_type,
acl: s3_permissions(style)
}

if @s3_acl_enabled
write_options[:acl] = s3_permissions(style)
end

# add storage class for this style if defined
storage_class = s3_storage_class(style)
write_options.merge!(storage_class: storage_class) if storage_class
Expand Down