action_policy 0.7.0 → 0.7.2
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 +4 -4
- data/CHANGELOG.md +15 -0
- data/lib/.rbnext/3.0/action_policy/policy/reasons.rb +1 -1
- data/lib/action_policy/authorizer.rb +1 -1
- data/lib/action_policy/policy/reasons.rb +1 -1
- data/lib/action_policy/policy/scoping.rb +1 -1
- data/lib/action_policy/rails/controller.rb +1 -1
- 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: 5c3b8d128bdf4e37224446e7c5a65698327a927c743e99757cf6f5363db93ff5
|
4
|
+
data.tar.gz: f046c13d93cff63aa06fd15f4d6375a8498c04d0637110df0ff86891a206fb84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b66f496343688a55907070ba6b6e82e24a5d358934d6809e1577e80f2c67a81342fe449cbf46942c1e8ff064f79ae898235efa32b63e9fc402e5b416bc223efc
|
7
|
+
data.tar.gz: 57088a306e642a0dd22a68c4da019dbd8669e7fa63ec1e99fb7bb819a563ca514be2200c669486d40f5a4b152a325ee0adc3abcaa6187b45c1f0ef37ddcb7a86
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,20 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 0.7.2 (2024-11-21)
|
6
|
+
|
7
|
+
- Fix missing details in deny! message interpolation. ([@palkan][])
|
8
|
+
|
9
|
+
- Fix implicit authorization target in anonymous controllers. ([@palkan][])
|
10
|
+
|
11
|
+
- Improve default `ActionPolicy::Unauthorized` error message. ([@Spone][])
|
12
|
+
|
13
|
+
Before: `Not Authorized` / After: `Not authorized: UserPolicy#create? returns false`
|
14
|
+
|
15
|
+
## 0.7.1 (2024-07-25)
|
16
|
+
|
17
|
+
- Support passing scope options to callable scope objects. ([@palkan][])
|
18
|
+
|
5
19
|
## 0.7.0 (2024-06-20)
|
6
20
|
|
7
21
|
- **Ruby 2.7+** is required.
|
@@ -520,3 +534,4 @@ This value is now stored in a cache (if any) instead of just the call result (`t
|
|
520
534
|
[@tomdalling]: https://github.com/tomdalling
|
521
535
|
[@matsales28]: https://github.com/matsales28
|
522
536
|
[@killondark]: https://github.com/killondark
|
537
|
+
[@Spone]: https://github.com/Spone
|
@@ -117,7 +117,7 @@ module ActionPolicy
|
|
117
117
|
name, callable = prepare_args(name, callable)
|
118
118
|
|
119
119
|
mid = :"__scoping__#{type}__#{name}"
|
120
|
-
block = ->(target) { callable.call(self, target) } if callable
|
120
|
+
block = ->(target, **opts) { callable.call(self, target, **opts) } if callable
|
121
121
|
|
122
122
|
define_method(mid, &block)
|
123
123
|
|
@@ -56,7 +56,7 @@ module ActionPolicy
|
|
56
56
|
# Tries to infer the resource class from controller name
|
57
57
|
# (i.e. `controller_name.classify.safe_constantize`).
|
58
58
|
def implicit_authorization_target
|
59
|
-
controller_name
|
59
|
+
controller_name&.classify&.safe_constantize
|
60
60
|
end
|
61
61
|
|
62
62
|
def verify_authorized
|
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.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Dementyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-next-core
|