consent 2.6.1 → 2.7.0
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/Gemfile.lock +1 -1
- data/docs/CHANGELOG.md +4 -0
- data/gemfiles/rails_7_1.gemfile.lock +1 -1
- data/gemfiles/rails_7_2.gemfile.lock +1 -1
- data/lib/consent/engine.rb +0 -4
- data/lib/consent/subject.rb +6 -2
- data/lib/consent/version.rb +1 -1
- 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: 163143501697303a6c4e748bdb0653ba3de05f109c2ba88bf314d9b6eecdb66f
|
|
4
|
+
data.tar.gz: 62c806e7ac65712121471a9a10e36f049bd9c0ebe9282df97ea0457c5f1f9652
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bb8508dab71c31a98d8427a492acc93e281bb9e4598e7a946a1237f1cfea77cdcfc48939adaf0f0cb15a9e0355b2c8c66a7e2c20f8f4020d326d7a2802d13fcb
|
|
7
|
+
data.tar.gz: 8ec14817c01eabb659153c2898d04334b45f1123bfb3c470b8d80e685e7b224710dda2a9752286cc8585003da4a8dd0fb095628c11d02cf8d27dcc5eae67b60a
|
data/Gemfile.lock
CHANGED
data/docs/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
### [2.7.0] - 2026-08-11
|
|
4
|
+
|
|
5
|
+
- Lazily load model subjects [#447](https://github.com/powerhome/power-tools/pull/447)
|
|
6
|
+
|
|
3
7
|
### [2.6.1] - 2026-06-26
|
|
4
8
|
|
|
5
9
|
- Fixed an issue where view and action comparisons did not work unless we converted their keys to strings. [#444](https://github.com/powerhome/power-tools/pull/444)
|
data/lib/consent/engine.rb
CHANGED
|
@@ -10,10 +10,6 @@ module Consent
|
|
|
10
10
|
config.consent = Consent::Reloader.new(default_path)
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
-
config.after_initialize do |app|
|
|
14
|
-
app.config.consent.execute
|
|
15
|
-
end
|
|
16
|
-
|
|
17
13
|
initializer "consent.reloader" do |app|
|
|
18
14
|
app.reloaders << config.consent
|
|
19
15
|
ActiveSupport::Dependencies.autoload_paths -= config.consent.paths
|
data/lib/consent/subject.rb
CHANGED
|
@@ -2,15 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
module Consent
|
|
4
4
|
class Subject # :nodoc:
|
|
5
|
-
attr_reader :
|
|
5
|
+
attr_reader :label, :actions, :views
|
|
6
6
|
|
|
7
7
|
def initialize(key, label)
|
|
8
|
-
@
|
|
8
|
+
@raw_key = key.respond_to?(:name) ? key.name : key
|
|
9
9
|
@label = label
|
|
10
10
|
@actions = []
|
|
11
11
|
@views = Consent.default_views.clone
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
+
def key
|
|
15
|
+
Consent::SubjectCoder.load(@raw_key)
|
|
16
|
+
end
|
|
17
|
+
|
|
14
18
|
def to_permission_payload
|
|
15
19
|
actions = self.actions.sort
|
|
16
20
|
views = self.views.values.sort
|
data/lib/consent/version.rb
CHANGED