Allow deferred & interval triggers
This commit is contained in:
@@ -129,6 +129,13 @@ func (svc automationTrigger) isValid(ctx context.Context, s *automation.Script,
|
||||
return errors.WithStack(ErrNoTriggerManagementPermissions)
|
||||
}
|
||||
}
|
||||
|
||||
case "interval",
|
||||
"deferred":
|
||||
if s.RunAs == 0 {
|
||||
return errors.WithStack(automation.ErrAutomationScriptMissingUser)
|
||||
}
|
||||
|
||||
default:
|
||||
return errors.WithStack(automation.ErrAutomationTriggerInvalidEvent)
|
||||
}
|
||||
|
||||
@@ -99,7 +99,8 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
ErrAutomationScriptInvalid = errors.New("AutomationScriptInvalid")
|
||||
ErrAutomationScriptInvalid = errors.New("AutomationScriptInvalid")
|
||||
ErrAutomationScriptMissingUser = errors.New("AutomationScriptMissingUser")
|
||||
)
|
||||
|
||||
// IsValid - enabled, deleted?
|
||||
|
||||
Reference in New Issue
Block a user