mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
provider rule events: allows to filter by user groups
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -95,6 +95,7 @@ func init() {
|
||||
}
|
||||
if u, ok := object.(*dataprovider.User); ok {
|
||||
p.Email = u.Email
|
||||
p.Groups = u.Groups
|
||||
} else if a, ok := object.(*dataprovider.Admin); ok {
|
||||
p.Email = a.Email
|
||||
}
|
||||
@@ -316,6 +317,9 @@ func (*eventRulesContainer) checkProviderEventMatch(conditions *dataprovider.Eve
|
||||
if !checkEventConditionPatterns(params.Name, conditions.Options.Names) {
|
||||
return false
|
||||
}
|
||||
if !checkEventGroupConditionPatterns(params.Groups, conditions.Options.GroupNames) {
|
||||
return false
|
||||
}
|
||||
if !checkEventConditionPatterns(params.Role, conditions.Options.RoleNames) {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user