effective_storage 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6b647a6cc8602078845e0112be3346f284705778fd081694deacf161a7ebf91
4
- data.tar.gz: 1340ad269815fc10141936f997da57860a30ecdbb760658706fc84cb69281d64
3
+ metadata.gz: ecd6dd02777954598cdab6c48f1f3ca0a97009dd7e34651edabcb08c21f7a59f
4
+ data.tar.gz: 239c1873844fa5036a1c62e4c7154bfb1705972eacdf4ebaad3c73900c2da559
5
5
  SHA512:
6
- metadata.gz: 9c28337427ce9d4ef0782cf951a2b1bb6e5004b7ef3f4f7df842dfe54e2dc5dfe1578576a03d38bb55de85f0c504a5c1896b586a7f57f9c16768d75504f42f93
7
- data.tar.gz: 307df9a832e70ae1709b0a24e6d665e1de1fedbad5d21d1b4347d8976ead29acd39682ffaac5eb83d0adc66f21c077139721df5d0e9707391b0996775e4c859e
6
+ metadata.gz: fbdfdbacfb2bc11023c480cc1389a3b28b063fb363b0dedd8d8c7a0daa6784c160366fdce088dd98fccc243388616f7ba669836afc53568feadc74371786c4bf
7
+ data.tar.gz: 91e69e42ccc3c1a10e06925f75a9d0e00c96907da53e167e94afc7a0914112508932892a5f4d6b8828f2dd7526c88dfb1d73d9c84dc91f592a25c324e352afe7
@@ -15,7 +15,7 @@ module ActiveStorageAuthorization
15
15
  extend ActiveSupport::Concern
16
16
 
17
17
  included do
18
- rescue_from(Exception, with: :unauthorized_active_storage_request)
18
+ rescue_from(Effective::UnauthorizedStorageException, with: :unauthorized_active_storage_request)
19
19
  end
20
20
 
21
21
  # Authorize ActiveStorage DiskController downloads
@@ -88,7 +88,7 @@ module ActiveStorageAuthorization
88
88
 
89
89
  resolution = "Missing can?(:show, #{(resource || record || attachment).class.name})"
90
90
 
91
- raise(error + '. ' + resolution)
91
+ raise Effective::UnauthorizedStorageException.new(error + '. ' + resolution)
92
92
  end
93
93
 
94
94
  # This is a file that was drag & drop or inserted into the article editor
@@ -0,0 +1,4 @@
1
+ module Effective
2
+ class UnauthorizedStorageException < Exception
3
+ end
4
+ end
@@ -1,3 +1,3 @@
1
1
  module EffectiveStorage
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_storage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-26 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: rails
@@ -139,6 +139,7 @@ files:
139
139
  - app/models/concerns/active_storage_authorization.rb
140
140
  - app/models/concerns/active_storage_blob_extension.rb
141
141
  - app/models/effective/active_storage_extension.rb
142
+ - app/models/effective/unauthorized_storage_exception.rb
142
143
  - app/views/admin/storage/_datatable_actions.html.haml
143
144
  - app/views/admin/storage/index.html.haml
144
145
  - config/effective_storage.rb