mxrb 0.1.0 → 0.1.1
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 80ac058134902cb839b9dacd80da635675e27fe0ac6fe3eb22dd833c551731ab
|
|
4
|
+
data.tar.gz: 291c3ce744371e4f89a9b0b63ae37200831d566a140285e26c0d3199482c6775
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 37566da77719ce1537886b96ed5189c080da1d8668aea9d7e4e5a3de7ffd18a81de67318ffbc005d5ab2a5b3dfbacf5e903439cf884c94b09c6c09b6148e1a75
|
|
7
|
+
data.tar.gz: f48190ec6af16e09d97246e7eb514f054ea7555b99560143766bb3df13f86fbcc47d8944a924bc3a70cd846410e14b845a4c64b5caec7e9f56866ec441b53355
|
|
@@ -110,13 +110,14 @@ module Mxrb
|
|
|
110
110
|
end
|
|
111
111
|
end
|
|
112
112
|
|
|
113
|
-
def primitive(type, value) # rubocop:disable Metrics/CyclomaticComplexity
|
|
113
|
+
def primitive(type, value) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
|
|
114
114
|
compiled = case type
|
|
115
115
|
when 'Boolean' then value['PrimitiveValue'] == 'true'
|
|
116
116
|
when 'Integer' then value['PrimitiveValue'].to_i
|
|
117
117
|
when 'Enumeration' then value['PrimitiveValue'].to_s
|
|
118
118
|
when 'TextTemplate' then raw(expression(translated_text(value['TextTemplate'])))
|
|
119
119
|
when 'Widgets' then [] if array(value['Widgets']).empty?
|
|
120
|
+
when 'Object' then [] if array(value['Objects']).empty?
|
|
120
121
|
end
|
|
121
122
|
compiled.nil? ? :undefined : compiled
|
|
122
123
|
end
|
|
@@ -1810,9 +1810,8 @@ module Mxrb
|
|
|
1810
1810
|
(@generic_widgets || {}).sort.each do |name, path|
|
|
1811
1811
|
imports.concat([
|
|
1812
1812
|
"import * as #{name}WidgetModule from \"../widgets/#{path}.mjs\";",
|
|
1813
|
-
"const #{name} =
|
|
1814
|
-
"#{
|
|
1815
|
-
"Object.getOwnPropertyDescriptor(#{name}WidgetModule, \"default\")?.value;"
|
|
1813
|
+
"const #{name} = #{name}WidgetModule[#{JSON.generate(name)}] || " \
|
|
1814
|
+
"#{name}WidgetModule.default;"
|
|
1816
1815
|
])
|
|
1817
1816
|
widgets << name
|
|
1818
1817
|
end
|
|
@@ -241,7 +241,8 @@ module Mxrb
|
|
|
241
241
|
{
|
|
242
242
|
'operationId' => self.class.operation_id(page_name, widget['Name']),
|
|
243
243
|
'operationType' => 'callMicroflow', 'parameters' => parameters,
|
|
244
|
-
'constants' => { 'MicroflowName' => name },
|
|
244
|
+
'constants' => { 'MicroflowName' => name },
|
|
245
|
+
'allowedUserRoleSets' => microflow_operation_role_sets(role_sets, name)
|
|
245
246
|
}
|
|
246
247
|
end
|
|
247
248
|
|
|
@@ -276,7 +277,7 @@ module Mxrb
|
|
|
276
277
|
'operationId' => self.class.operation_id(page_name, widget['Name']),
|
|
277
278
|
'operationType' => 'retrieveByMicroflow', 'parameters' => microflow_parameters(source.microflow_name) || {},
|
|
278
279
|
'constants' => data_source_constants(page_name, widget, source.microflow_name),
|
|
279
|
-
'allowedUserRoleSets' => role_sets
|
|
280
|
+
'allowedUserRoleSets' => microflow_operation_role_sets(role_sets, source.microflow_name)
|
|
280
281
|
}
|
|
281
282
|
end
|
|
282
283
|
|
|
@@ -340,7 +341,8 @@ module Mxrb
|
|
|
340
341
|
{
|
|
341
342
|
'operationId' => self.class.operation_id(page_name, widget['Name']),
|
|
342
343
|
'operationType' => 'callMicroflow', 'parameters' => parameters,
|
|
343
|
-
'constants' => { 'MicroflowName' => name },
|
|
344
|
+
'constants' => { 'MicroflowName' => name },
|
|
345
|
+
'allowedUserRoleSets' => microflow_operation_role_sets(role_sets, name)
|
|
344
346
|
}
|
|
345
347
|
end
|
|
346
348
|
|
|
@@ -352,7 +354,7 @@ module Mxrb
|
|
|
352
354
|
'operationId' => self.class.operation_id(page_name, widget['Name']),
|
|
353
355
|
'operationType' => 'retrieveByMicroflow', 'parameters' => parameters,
|
|
354
356
|
'constants' => data_source_constants(page_name, widget, name),
|
|
355
|
-
'allowedUserRoleSets' => role_sets
|
|
357
|
+
'allowedUserRoleSets' => microflow_operation_role_sets(role_sets, name)
|
|
356
358
|
}
|
|
357
359
|
end
|
|
358
360
|
|
|
@@ -455,7 +457,9 @@ module Mxrb
|
|
|
455
457
|
nested(document, 'Microflows$ActionActivity').filter_map do |activity|
|
|
456
458
|
action = activity['Action'] || {}
|
|
457
459
|
operation = nanoflow_server_operation(qualified_name, activity, action, entities)
|
|
458
|
-
operation&.
|
|
460
|
+
name = operation&.dig('constants', 'MicroflowName')
|
|
461
|
+
role_sets = name ? microflow_operation_role_sets([], name) : []
|
|
462
|
+
operation&.merge('allowedUserRoleSets' => role_sets)
|
|
459
463
|
end
|
|
460
464
|
end
|
|
461
465
|
|
|
@@ -537,6 +541,15 @@ module Mxrb
|
|
|
537
541
|
end
|
|
538
542
|
end # rubocop:enable Metrics/AbcSize
|
|
539
543
|
|
|
544
|
+
def microflow_operation_role_sets(container_role_sets, qualified_name)
|
|
545
|
+
flow = qualified_unit('Microflows$Microflow', qualified_name)
|
|
546
|
+
flow_role_sets = flow ? allowed_user_role_sets(flow) : []
|
|
547
|
+
return container_role_sets if flow_role_sets.empty?
|
|
548
|
+
return flow_role_sets if container_role_sets.empty?
|
|
549
|
+
|
|
550
|
+
container_role_sets & flow_role_sets
|
|
551
|
+
end
|
|
552
|
+
|
|
540
553
|
def constants(page_name, widget, constraint, entity)
|
|
541
554
|
{
|
|
542
555
|
'PageName' => page_name, 'WidgetName' => "#{page_name}.#{widget['Name']}",
|
data/lib/mxrb/version.rb
CHANGED