motor-admin 0.2.51 → 0.2.53
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/motor/build_schema/apply_permissions.rb +8 -3
- data/lib/motor/build_schema/load_from_rails.rb +2 -1
- data/lib/motor/configs/build_ui_app_tag.rb +9 -1
- data/lib/motor/version.rb +1 -1
- data/ui/dist/{main-2f07e682c44815a0eb71.css.gz → main-f5a4c21edafaf5c70b05.css.gz} +0 -0
- data/ui/dist/main-f5a4c21edafaf5c70b05.js.gz +0 -0
- data/ui/dist/manifest.json +5 -5
- metadata +4 -4
- data/ui/dist/main-2f07e682c44815a0eb71.js.gz +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67bb67c4a201104a29894b80a8bd242f1cf10b49cb6d385714581e7cc7497879
|
4
|
+
data.tar.gz: 7982ff5d3c3636c2f6fd4216cd038e33c62f4af603a345900cf05512b5b1fe54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 949241fdf2ac8b47d2eb1ff796f11b2784a45226a2abf23bc4ffcb60a2c5f0947e02dd04b20d488f9fcb52ba06eedffc5cccff9d3fcf1a1dd253157bda133e0d
|
7
|
+
data.tar.gz: '08b26b86e8cdd556b1230a09539a891aa0c6b863b6a6f3bf62ccb69926bdbbd057fb6a38bb5bfd384652fda1a73aab02d2edbebedf6175c254656e6aa2817caa'
|
@@ -21,7 +21,9 @@ module Motor
|
|
21
21
|
|
22
22
|
def filter_associations(associations, ability)
|
23
23
|
associations.select do |assoc|
|
24
|
-
|
24
|
+
model_class = assoc[:model_name].classify.safe_constantize
|
25
|
+
|
26
|
+
model_class && ability.can?(:read, model_class)
|
25
27
|
end
|
26
28
|
end
|
27
29
|
|
@@ -29,8 +31,11 @@ module Motor
|
|
29
31
|
columns.map do |column|
|
30
32
|
next unless ability.can?(:read, model, column[:name])
|
31
33
|
|
32
|
-
|
33
|
-
|
34
|
+
reference_model_name = column.dig(:reference, :model_name)
|
35
|
+
model_class = reference_model_name&.classify&.safe_constantize
|
36
|
+
|
37
|
+
next if reference_model_name &&
|
38
|
+
(model_class.nil? || !ability.can?(:read, model_class))
|
34
39
|
|
35
40
|
unless ability.can?(:update, model, column[:name])
|
36
41
|
column = column.merge(access_type: BuildSchema::ColumnAccessTypes::READ_ONLY)
|
@@ -154,7 +154,8 @@ module Motor
|
|
154
154
|
|
155
155
|
return {} if column.name == 'year'
|
156
156
|
|
157
|
-
return { number_format: true } if !column.name
|
157
|
+
return { number_format: true } if !column.name == 'id' &&
|
158
|
+
!column.name.match?(/_(?:id|year)\z/) &&
|
158
159
|
%i[integer float].include?(column.type)
|
159
160
|
|
160
161
|
{}
|
@@ -13,7 +13,7 @@ module Motor
|
|
13
13
|
module_function
|
14
14
|
|
15
15
|
def call(current_user = nil, current_ability = nil, cache_keys: LoadFromCache.load_cache_keys)
|
16
|
-
CACHE_STORE.fetch(
|
16
|
+
CACHE_STORE.fetch(app_tag_cache_key(cache_keys, current_user, current_ability)) do
|
17
17
|
CACHE_STORE.clear
|
18
18
|
|
19
19
|
data = build_data(cache_keys, current_user, current_ability)
|
@@ -21,6 +21,14 @@ module Motor
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
+
def app_tag_cache_key(cache_keys, current_user, current_ability)
|
25
|
+
key = "#{I18n.locale}#{cache_keys.hash}#{current_user&.id}#{current_ability&.rules_hash}"
|
26
|
+
|
27
|
+
key += Motor::DefineArModels.defined_models_schema_md5.to_s if defined?(Motor::DefineArModels)
|
28
|
+
|
29
|
+
key
|
30
|
+
end
|
31
|
+
|
24
32
|
# rubocop:disable Metrics/AbcSize
|
25
33
|
# @return [Hash]
|
26
34
|
def build_data(cache_keys = {}, current_user = nil, current_ability = nil)
|
data/lib/motor/version.rb
CHANGED
File without changes
|
Binary file
|
data/ui/dist/manifest.json
CHANGED
@@ -2601,9 +2601,9 @@
|
|
2601
2601
|
"icons/zoom-out.svg.gz": "icons/zoom-out.svg.gz",
|
2602
2602
|
"icons/zoom-question.svg": "icons/zoom-question.svg",
|
2603
2603
|
"icons/zoom-question.svg.gz": "icons/zoom-question.svg.gz",
|
2604
|
-
"main-
|
2605
|
-
"main-
|
2606
|
-
"main-
|
2607
|
-
"main.css": "main-
|
2608
|
-
"main.js": "main-
|
2604
|
+
"main-f5a4c21edafaf5c70b05.css.gz": "main-f5a4c21edafaf5c70b05.css.gz",
|
2605
|
+
"main-f5a4c21edafaf5c70b05.js.LICENSE.txt": "main-f5a4c21edafaf5c70b05.js.LICENSE.txt",
|
2606
|
+
"main-f5a4c21edafaf5c70b05.js.gz": "main-f5a4c21edafaf5c70b05.js.gz",
|
2607
|
+
"main.css": "main-f5a4c21edafaf5c70b05.css",
|
2608
|
+
"main.js": "main-f5a4c21edafaf5c70b05.js"
|
2609
2609
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motor-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.53
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Matsyburka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord-filter
|
@@ -1532,8 +1532,8 @@ files:
|
|
1532
1532
|
- ui/dist/icons/zoom-money.svg.gz
|
1533
1533
|
- ui/dist/icons/zoom-out.svg.gz
|
1534
1534
|
- ui/dist/icons/zoom-question.svg.gz
|
1535
|
-
- ui/dist/main-
|
1536
|
-
- ui/dist/main-
|
1535
|
+
- ui/dist/main-f5a4c21edafaf5c70b05.css.gz
|
1536
|
+
- ui/dist/main-f5a4c21edafaf5c70b05.js.gz
|
1537
1537
|
- ui/dist/manifest.json
|
1538
1538
|
homepage:
|
1539
1539
|
licenses:
|
Binary file
|