nexus_cqrs 0.4.6 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/lib/nexus_cqrs/auth/permission_provider.rb +4 -4
- data/lib/nexus_cqrs/version.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5eaaa5907400751d2a1e04da16226885b6945a6d04ec5c10b513cec92e10123a
|
4
|
+
data.tar.gz: aecdbe537dd07314b8e5d66d4c312a353b2d23fade004412a26998c041ea7af0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbc0b64117f244c62d96f9fb75c7c030e9d8ab62e4cf206396066dbf7eeb416fda0787c506d567eae31d56d06e135eee1922fbcbc48411b937505fe33d90186f
|
7
|
+
data.tar.gz: 2c103ccfa697dad306e40eebe48b856bfd7bc2e347ce728bce8c560adc68c2a2c31f007c0c556d637a78daaf967c9f1127c4e196d842ac5ffb3ea3cafd5aa4fb
|
data/Gemfile.lock
CHANGED
@@ -33,14 +33,14 @@ GEM
|
|
33
33
|
zeitwerk (~> 2.3)
|
34
34
|
ast (2.4.2)
|
35
35
|
builder (3.2.4)
|
36
|
-
concurrent-ruby (1.1.
|
36
|
+
concurrent-ruby (1.1.10)
|
37
37
|
crass (1.0.6)
|
38
38
|
diff-lcs (1.4.4)
|
39
39
|
erubi (1.10.0)
|
40
40
|
generator_spec (0.9.4)
|
41
41
|
activesupport (>= 3.0.0)
|
42
42
|
railties (>= 3.0.0)
|
43
|
-
i18n (1.
|
43
|
+
i18n (1.10.0)
|
44
44
|
concurrent-ruby (~> 1.0)
|
45
45
|
ibsciss-middleware (0.4.2)
|
46
46
|
loofah (2.12.0)
|
@@ -48,7 +48,7 @@ GEM
|
|
48
48
|
nokogiri (>= 1.5.9)
|
49
49
|
method_source (1.0.0)
|
50
50
|
mini_portile2 (2.6.1)
|
51
|
-
minitest (5.
|
51
|
+
minitest (5.15.0)
|
52
52
|
nokogiri (1.12.5)
|
53
53
|
mini_portile2 (~> 2.6.1)
|
54
54
|
racc (~> 1.4)
|
@@ -111,7 +111,7 @@ GEM
|
|
111
111
|
tzinfo (2.0.4)
|
112
112
|
concurrent-ruby (~> 1.0)
|
113
113
|
unicode-display_width (2.1.0)
|
114
|
-
zeitwerk (2.5.
|
114
|
+
zeitwerk (2.5.4)
|
115
115
|
|
116
116
|
PLATFORMS
|
117
117
|
ruby
|
@@ -54,7 +54,7 @@ module NexusCqrs
|
|
54
54
|
def for_user_on_entity(permission_model, entity_id)
|
55
55
|
return [] if @user_id.nil?
|
56
56
|
|
57
|
-
# retrieve entity-specific permissions from
|
57
|
+
# retrieve entity-specific permissions from cached user permissions and map to hash
|
58
58
|
entity_permissions = if cached_permissions(permission_model).key?(entity_id)
|
59
59
|
cached_permissions(permission_model)[entity_id]
|
60
60
|
.map { |p| { global: false, key: p } }
|
@@ -71,7 +71,7 @@ module NexusCqrs
|
|
71
71
|
|
72
72
|
# Retrieves a list of permissions assigned to a user for ANY entity ID
|
73
73
|
#
|
74
|
-
# @param [
|
74
|
+
# @param [Class] permission_model Permission model class
|
75
75
|
# @return [Hash] Returns a hash representing each entity and the user's permissions
|
76
76
|
# @example Get a list of permissions
|
77
77
|
# permissions.for_user(CollectionPermissions) #=>
|
@@ -117,10 +117,10 @@ module NexusCqrs
|
|
117
117
|
# Retrieve all the permissions for this user for a specific model and cache it for this request (as all calls to
|
118
118
|
# a PermissionProvider in the same request will all have the same permissions, this saves on many SQL calls)
|
119
119
|
#
|
120
|
-
# @param [
|
120
|
+
# @param [Class] permission_model Class for the permission model being used.
|
121
121
|
# @see PermissionProvider#for_user
|
122
122
|
def cached_permissions(permission_model)
|
123
|
-
::RequestStore.store[
|
123
|
+
::RequestStore.store["permissions_#{permission_model.name}"] ||= for_user(permission_model)
|
124
124
|
end
|
125
125
|
end
|
126
126
|
end
|
data/lib/nexus_cqrs/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nexus_cqrs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dean Lovett
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: generator_spec
|
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
- !ruby/object:Gem::Version
|
155
155
|
version: '0'
|
156
156
|
requirements: []
|
157
|
-
rubygems_version: 3.3.
|
157
|
+
rubygems_version: 3.3.24
|
158
158
|
signing_key:
|
159
159
|
specification_version: 4
|
160
160
|
summary: Core package for the nexus cqrs gem
|