26 lines
657 B
Go
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
|
|
}
|