Add prefix "*act" for scheduler filter

This commit is contained in:
TeoV
2019-11-08 10:07:26 +02:00
committed by Dan Christian Bogos
parent 2f3f7d2dea
commit 7c95645650
4 changed files with 7 additions and 3 deletions

View File

@@ -35,7 +35,7 @@
"scheduler": {
"enabled": true,
"filters": ["*suffix:~AccountID:1001"],
"filters": ["*suffix:~*act.AccountID:1001"],
},

View File

@@ -35,7 +35,7 @@
"scheduler": {
"enabled": true,
"filters": ["*suffix:~AccountID:1002;1003"],
"filters": ["*suffix:~*act.AccountID:1002;1003"],
},

View File

@@ -67,7 +67,10 @@ func (t *Task) FieldAsString(fldPath []string) (s string, err error) {
if len(fldPath) == 0 {
return
}
switch fldPath[0] {
if fldPath[0] != utils.MetaAct || len(fldPath) < 2 {
return "", utils.ErrPrefixNotFound(strings.Join(fldPath, utils.NestingSep))
}
switch fldPath[1] {
case utils.UUID:
return t.Uuid, nil
case utils.AccountID:

View File

@@ -572,6 +572,7 @@ const (
QueryLow = "query"
UUID = "UUID"
ActionsID = "ActionsID"
MetaAct = "*act"
)
// Migrator Action