forest_liana 9.5.1 → 9.5.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 331a5a4b04f74fad06fa9b8f9443e2a91c27685483fb1bba39bedb1b409c498c
|
4
|
+
data.tar.gz: 055da277ebd38b2617dbc5b61a24dfb0b0bf474bb65fb8763d50ed694926122a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50c346b60aea696ed3295aa82c51cb92167e94c0a24168f039f1d673f2c9e48bed79b6699004d00b55e35bfb3b1ed55a0465c8f8b824256e645da831ca6b89cd
|
7
|
+
data.tar.gz: aa3fd7c4133120ff50c0c88a4ab0b5873a6f5a28d1acd83b11a409a3557e15c0f8dbad572a43f44f39e1ba0d142f282a4a9a9ebf68e8496d7cd1425eedd0b5ed
|
@@ -22,7 +22,7 @@ module ForestLiana
|
|
22
22
|
|
23
23
|
def can_approve?
|
24
24
|
@parameters = RequestPermission.decodeSignedApprovalRequest(@parameters)
|
25
|
-
if ((@smart_action['userApprovalConditions'].
|
25
|
+
if ((condition_by_role_id(@smart_action['userApprovalConditions']).blank? || match_conditions('userApprovalConditions')) &&
|
26
26
|
(@parameters[:data][:attributes][:requester_id] != @user['id'] || @smart_action['selfApprovalEnabled'].include?(@user['roleId']))
|
27
27
|
)
|
28
28
|
return true
|
@@ -33,12 +33,12 @@ module ForestLiana
|
|
33
33
|
|
34
34
|
def can_trigger?
|
35
35
|
if @smart_action['triggerEnabled'].include?(@user['roleId']) && @smart_action['approvalRequired'].exclude?(@user['roleId'])
|
36
|
-
return true if @smart_action['triggerConditions'].
|
36
|
+
return true if condition_by_role_id(@smart_action['triggerConditions']).blank? || match_conditions('triggerConditions')
|
37
37
|
elsif @smart_action['approvalRequired'].include?(@user['roleId'])
|
38
|
-
if @smart_action['approvalRequiredConditions'].
|
38
|
+
if condition_by_role_id(@smart_action['approvalRequiredConditions']).blank? || match_conditions('approvalRequiredConditions')
|
39
39
|
raise ForestLiana::Ability::Exceptions::RequireApproval.new(@smart_action['userApprovalEnabled'])
|
40
40
|
else
|
41
|
-
return true if @smart_action['triggerConditions'].
|
41
|
+
return true if condition_by_role_id(@smart_action['triggerConditions']).blank? || match_conditions('triggerConditions')
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
@@ -48,8 +48,10 @@ module ForestLiana
|
|
48
48
|
def match_conditions(condition_name)
|
49
49
|
begin
|
50
50
|
attributes = @parameters[:data][:attributes]
|
51
|
+
condition = condition_by_role_id(@smart_action[condition_name])
|
52
|
+
|
51
53
|
records = FiltersParser.new(
|
52
|
-
|
54
|
+
condition['filter'],
|
53
55
|
@collection,
|
54
56
|
@parameters[:timezone],
|
55
57
|
@parameters
|
@@ -67,6 +69,10 @@ module ForestLiana
|
|
67
69
|
raise ForestLiana::Ability::Exceptions::ActionConditionError.new
|
68
70
|
end
|
69
71
|
end
|
72
|
+
|
73
|
+
def condition_by_role_id(condition)
|
74
|
+
condition.find { |c| c['roleId'] == @user['roleId'] }
|
75
|
+
end
|
70
76
|
end
|
71
77
|
end
|
72
78
|
end
|
data/lib/forest_liana/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forest_liana
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.5.
|
4
|
+
version: 9.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sandro Munda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|