Browse files

storing with correct permissions

  • Loading branch information...
1 parent 4d4fa4f commit 8fc678cafa56ec4561b457452a2b283e98d33f4b @heythisisnate committed Aug 6, 2009
Showing with 5 additions and 4 deletions.
  1. +4 −3 lib/paperclip/storage.rb
  2. +1 −1 paperclip.gemspec
View
7 lib/paperclip/storage.rb
@@ -192,10 +192,11 @@ def flush_writes #:nodoc:
@queued_for_write.each do |style, file|
begin
log("saving #{path(style)}")
+ permissions = %{thumb small}.include?(style.to_s) ? :public_read : :authenticated_read
AWS::S3::S3Object.store(path(style),
- file,
- bucket_name,
- {:content_type => instance_read(:content_type)}.merge(@s3_headers))
+ file,
+ bucket_name,
+ {:content_type => instance_read(:content_type)}.merge({:access => permissions}).merge(@s3_headers))
rescue AWS::S3::ResponseError => e
raise
end
View
2 paperclip.gemspec
@@ -2,7 +2,7 @@
Gem::Specification.new do |s|
s.name = %q{paperclip}
- s.version = "2.3.0.4"
+ s.version = "2.3.0.5"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Jon Yurek"]

0 comments on commit 8fc678c

Please sign in to comment.