bugfix: System users can now be used in ACLs (#396)
This commit is contained in:
parent
6413e51cf5
commit
3f1dbf1130
|
|
@ -107,12 +107,10 @@ func exec(instant time.Time, action *config.Action, cfg *config.Config, ex *exec
|
||||||
}).Infof("Executing action from calendar")
|
}).Infof("Executing action from calendar")
|
||||||
|
|
||||||
req := &executor.ExecutionRequest{
|
req := &executor.ExecutionRequest{
|
||||||
Action: action,
|
Action: action,
|
||||||
Cfg: cfg,
|
Cfg: cfg,
|
||||||
Tags: []string{"calendar"},
|
Tags: []string{"calendar"},
|
||||||
AuthenticatedUser: &acl.AuthenticatedUser{
|
AuthenticatedUser: acl.UserFromSystem(cfg, "calendar"),
|
||||||
Username: "calendar",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ex.ExecRequest(req)
|
ex.ExecRequest(req)
|
||||||
|
|
|
||||||
|
|
@ -34,12 +34,10 @@ func scheduleAction(cfg *config.Config, scheduler *cron.Cron, cronline string, e
|
||||||
|
|
||||||
_, err := scheduler.AddFunc(cronline, func() {
|
_, err := scheduler.AddFunc(cronline, func() {
|
||||||
req := &executor.ExecutionRequest{
|
req := &executor.ExecutionRequest{
|
||||||
ActionTitle: action.Title,
|
ActionTitle: action.Title,
|
||||||
Cfg: cfg,
|
Cfg: cfg,
|
||||||
Tags: []string{"cron"},
|
Tags: []string{"cron"},
|
||||||
AuthenticatedUser: &acl.AuthenticatedUser{
|
AuthenticatedUser: acl.UserFromSystem(cfg, "cron"),
|
||||||
Username: "cron",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ex.ExecRequest(req)
|
ex.ExecRequest(req)
|
||||||
|
|
|
||||||
|
|
@ -44,13 +44,11 @@ func scheduleExec(action *config.Action, cfg *config.Config, ex *executor.Execut
|
||||||
fmt.Printf("%+v", args)
|
fmt.Printf("%+v", args)
|
||||||
|
|
||||||
req := &executor.ExecutionRequest{
|
req := &executor.ExecutionRequest{
|
||||||
ActionTitle: action.Title,
|
ActionTitle: action.Title,
|
||||||
Cfg: cfg,
|
Cfg: cfg,
|
||||||
Tags: []string{"fileindir"},
|
Tags: []string{"fileindir"},
|
||||||
Arguments: args,
|
Arguments: args,
|
||||||
AuthenticatedUser: &acl.AuthenticatedUser{
|
AuthenticatedUser: acl.UserFromSystem(cfg, "fileindir"),
|
||||||
Username: "fileindir",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ex.ExecRequest(req)
|
ex.ExecRequest(req)
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func Execute(cfg *config.Config, ex *executor.Executor) {
|
func Execute(cfg *config.Config, ex *executor.Executor) {
|
||||||
user := &acl.AuthenticatedUser{
|
user := acl.UserFromSystem(cfg, "startup-user")
|
||||||
Username: "startup-user",
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, action := range cfg.Actions {
|
for _, action := range cfg.Actions {
|
||||||
if action.ExecOnStartup {
|
if action.ExecOnStartup {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue