3
0
Files
corteza/system/service/event/application.go
2020-01-18 07:05:35 +01:00

26 lines
657 B
Go

package event
import (
"github.com/cortezaproject/corteza-server/pkg/eventbus"
"github.com/cortezaproject/corteza-server/system/types"
)
// Match returns false if given conditions do not match event & resource internals
func (res applicationBase) Match(c eventbus.ConstraintMatcher) bool {
return applicationMatch(res.application, c, false)
}
// Handles application matchers
func applicationMatch(r *types.Application, c eventbus.ConstraintMatcher, def bool) bool {
switch c.Name() {
// not supported yet
//case "application", "application.handle":
// return c.Match(r.Handle)
case "application.name":
return c.Match(r.Name)
}
return def
}