authorizy 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/authorizy/config.rb +1 -1
- data/lib/authorizy/version.rb +1 -1
- data/spec/authorizy/config/denied_spec.rb +5 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adf5a52d89eabb0dd6503d0f96fb44ae9d4268213a6da8b91fb758805db97371
|
4
|
+
data.tar.gz: 01bcedd187623c4364c38d0c4f53b5a12ee1877f4426df44b21cc3b7446f6b5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0623f322536c3a6de17848f3f6b3642d70041384e220d0417d028a045d59970c97dfa84e659dd6a95795fe30f2ed09bb7d6203cf0bc7b600fbea0e53ff63bec5
|
7
|
+
data.tar.gz: 4e4862f37eb92ef4c0eb247ecd0fa0abe0652d6d750b282bb20908fadaf3dbaf54738ed51167cfa5784e1d158a441d349c75f9a460981c800def31df30b1d002
|
data/CHANGELOG.md
CHANGED
data/lib/authorizy/config.rb
CHANGED
@@ -14,7 +14,7 @@ module Authorizy
|
|
14
14
|
|
15
15
|
return context.render(json: { message: info }, status: 403) if context.request.xhr?
|
16
16
|
|
17
|
-
context.redirect_to(redirect_url.call(
|
17
|
+
context.redirect_to(redirect_url.call(context), info: info)
|
18
18
|
}
|
19
19
|
|
20
20
|
@dependencies = {}
|
data/lib/authorizy/version.rb
CHANGED
@@ -25,16 +25,18 @@ RSpec.describe Authorizy::Config, '#denied' do
|
|
25
25
|
let!(:context) do
|
26
26
|
double('context',
|
27
27
|
params: { controller: 'users', action: 'index' },
|
28
|
-
request: OpenStruct.new(xhr?: false)
|
28
|
+
request: OpenStruct.new(xhr?: false),
|
29
|
+
root_url: 'root_url'
|
29
30
|
)
|
30
31
|
end
|
31
32
|
|
32
|
-
it '
|
33
|
+
it 'redirects' do
|
33
34
|
allow(context).to receive(:redirect_to)
|
35
|
+
allow(context).to receive(:respond_to?).with(:root_url).and_return(true)
|
34
36
|
|
35
37
|
config.denied.call(context)
|
36
38
|
|
37
|
-
expect(context).to have_received(:redirect_to).with('
|
39
|
+
expect(context).to have_received(:redirect_to).with('root_url', info: 'Action denied for users#index')
|
38
40
|
end
|
39
41
|
end
|
40
42
|
end
|