action_policy 0.6.6 → 0.6.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/action_policy/railtie.rb +7 -7
- data/lib/action_policy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df57cf926c648dc59ed1a1afc44b352eb998f5bf03a9405127105611e641ffdb
|
4
|
+
data.tar.gz: 51a8e81c6479bf06894da3a2f8fa83c98ed25da678e73bf2462f029a75c55ec4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c55e23ffeff3a1d9800512759105e509abb6b51dabee1a984c56f04daa04e661ef37e056e2fee64b86a17bff8fab8167b557d8f5fe6bd9118febf0b116f7b3a
|
7
|
+
data.tar.gz: 8c1459872bb8daa8bca216c1ee342b9c8c4b4b6fb5654301765ec4d2c7f8ff6612ab784269a89920c29f575ee9ecd79b2a470a415f92246db70c0b9d7a3631b1
|
data/CHANGELOG.md
CHANGED
@@ -61,8 +61,8 @@ module ActionPolicy # :nodoc:
|
|
61
61
|
app.executor.to_complete { ActionPolicy::PerThreadCache.clear_all }
|
62
62
|
end
|
63
63
|
|
64
|
-
|
65
|
-
if
|
64
|
+
initializer "action_policy.extensions" do |app|
|
65
|
+
if app.config.action_policy.instrumentation_enabled
|
66
66
|
require "action_policy/rails/policy/instrumentation"
|
67
67
|
require "action_policy/rails/authorizer"
|
68
68
|
|
@@ -71,26 +71,26 @@ module ActionPolicy # :nodoc:
|
|
71
71
|
end
|
72
72
|
|
73
73
|
ActionPolicy::LookupChain.namespace_cache_enabled =
|
74
|
-
|
74
|
+
app.config.action_policy.namespace_cache_enabled
|
75
75
|
|
76
76
|
ActiveSupport.on_load(:action_controller) do
|
77
77
|
require "action_policy/rails/scope_matchers/action_controller_params"
|
78
78
|
|
79
|
-
next unless
|
79
|
+
next unless app.config.action_policy.auto_inject_into_controller
|
80
80
|
|
81
81
|
ActionController::Base.include ActionPolicy::Controller
|
82
82
|
|
83
|
-
next unless
|
83
|
+
next unless app.config.action_policy.controller_authorize_current_user
|
84
84
|
|
85
85
|
ActionController::Base.authorize :user, through: :current_user
|
86
86
|
end
|
87
87
|
|
88
88
|
ActiveSupport.on_load(:action_cable) do
|
89
|
-
next unless
|
89
|
+
next unless app.config.action_policy.auto_inject_into_channel
|
90
90
|
|
91
91
|
ActionCable::Channel::Base.include ActionPolicy::Channel
|
92
92
|
|
93
|
-
next unless
|
93
|
+
next unless app.config.action_policy.channel_authorize_current_user
|
94
94
|
|
95
95
|
ActionCable::Channel::Base.authorize :user, through: :current_user
|
96
96
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: action_policy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Dementyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-next-core
|