bizside 2.1.9 → 2.1.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff64fefe7426e051c6a8dfbbf37a45e40780afd5ded6fb08771783a4cbeb04ec
4
- data.tar.gz: 36f857fe7739917d3ef2a4215094e645b08e443a93a2143ecaf2c24a8b9ef4b5
3
+ metadata.gz: db766ed6fdf059cdaa9fd7325c855f84294c988f94559c39597658a674dc6c40
4
+ data.tar.gz: e26eaddb5f279e4d840baae4346d416e6f4467b102dea75a90d301c95a458649
5
5
  SHA512:
6
- metadata.gz: d609790daa2c1b7ac515563ecd0716dea901c9dc29e5a75e67db3512857d7f2948ab8410cb948761b821a90a3ebaf1d95f591de2f614bef862105f2432256af1
7
- data.tar.gz: fe79fc79a6c6c8b209f41275d9a012973da88fd2329d3d82894b24e337a8668e968251711d537022985035d1e083d36a7b0fc299eb6a6d1fce9c1006a3564403
6
+ metadata.gz: 5635c741923a924331b20dfa0b027e6adfc220a371306f2792f51569e48da21250c6fd0f4dc0d29d7116215edb36e6bcf73a417c1b55d5d19ff6c5317e176c0b
7
+ data.tar.gz: 63c3ba3993e0c9da71c236e9e197be92096330323aa10352f5848478722df2cd5e3ff7f5d716bbc3753fe19bdef56de02ea195591d89ebf73d95e1cd79d33e04
@@ -47,6 +47,66 @@ CarrierWave.configure do |config|
47
47
  config.fog_directory = Bizside.config.storage.fog.container
48
48
  config.fog_public = false
49
49
  config.storage = :fog
50
+
51
+ # Patch to not set ACLs to 'private' if fog_public is false.
52
+ # Requests to set/update ACLs fail if ACL is disabled.
53
+ # Setting 'private' to ACLs also fails when the bucket is not in the same account as IAM user/role.
54
+ # 'private' is applied by default so there's no need to set 'private' explicitly.
55
+ module CarrierWave
56
+ module Storage
57
+ class Fog
58
+ class File
59
+ def acl_header
60
+ if fog_provider == 'AWS'
61
+ @uploader.fog_public ? { 'x-amz-acl' => 'public-read' } : {}
62
+ elsif fog_provider == "Google"
63
+ @uploader.fog_public ? { destination_predefined_acl: "publicRead" } : {}
64
+ else
65
+ {}
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
72
+
73
+ require 'fog/aws/models/storage/directory'
74
+
75
+ module Fog
76
+ module AWS
77
+ class Storage
78
+ class Directory < Fog::Model
79
+ def public=(new_public)
80
+ if new_public
81
+ @acl = 'public-read'
82
+ else
83
+ @acl = nil
84
+ end
85
+ new_public
86
+ end
87
+ end
88
+ end
89
+ end
90
+ end
91
+
92
+ require 'fog/aws/models/storage/file'
93
+
94
+ module Fog
95
+ module AWS
96
+ class Storage
97
+ class File < Fog::Model
98
+ def public=(new_public)
99
+ if new_public
100
+ @acl = 'public-read'
101
+ else
102
+ @acl = nil
103
+ end
104
+ new_public
105
+ end
106
+ end
107
+ end
108
+ end
109
+ end
50
110
  end
51
111
 
52
112
  end
@@ -1,3 +1,3 @@
1
1
  module Bizside
2
- VERSION = '2.1.9'
2
+ VERSION = '2.1.10'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bizside
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.9
4
+ version: 2.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - bizside-developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-14 00:00:00.000000000 Z
11
+ date: 2022-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport