forest_liana 9.5.1 → 9.5.2
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: 93e5e9bbc17d64a32b2d38ce4effa876d682c356dbf1d180eb5e0117db644604
|
4
|
+
data.tar.gz: 52b8528c2d513cd0b906d8d69f7a163053976cdfc09fdb8484f83702354c2b23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40fd658783f4362c1ec6fd94224a160d31ee29277f87eee3bfc53223d91f4e7854be9ba6c0eecd645c39723c5e4338962fc70b785c53e0e527a9e687b8fc3660
|
7
|
+
data.tar.gz: 2620e9af72ecf6c7cd596ac4d596c36b10477b3ee0091cacb1758c233e890b85719c5acdfe678fffdc2e41e6c07c501585ddb6f81cd65b597a8864cd58187d06
|
@@ -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.2
|
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-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|