mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 06:40:54 +03:00
make GroupConditionPatterns uniform with the accepted PR
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -1169,13 +1169,24 @@ func checkEventGroupConditionPatterns(groups []sdk.GroupMapping, patterns []data
|
||||
if len(patterns) == 0 {
|
||||
return true
|
||||
}
|
||||
matches := false
|
||||
for _, group := range groups {
|
||||
if checkEventConditionPatterns(group.Name, patterns) {
|
||||
return true
|
||||
for _, p := range patterns {
|
||||
// assume, that multiple InverseMatches are set
|
||||
if p.InverseMatch {
|
||||
if checkEventConditionPattern(p, group.Name) {
|
||||
matches = true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
if checkEventConditionPattern(p, group.Name) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
return matches
|
||||
}
|
||||
|
||||
func getHTTPRuleActionEndpoint(c *dataprovider.EventActionHTTPConfig, replacer *strings.Replacer) (string, error) {
|
||||
|
||||
Reference in New Issue
Block a user