Fix server script security
Security params must be processed before procesing iterator
This commit is contained in:
parent
32ce2216cb
commit
63eb346a4a
@ -449,6 +449,15 @@ func (svc *service) registerServerScripts(ss ...*ServerScript) {
|
||||
Iterator: script.Iterator,
|
||||
}
|
||||
|
||||
if len(s.Errors) == 0 {
|
||||
if sec, rr, err := svc.serverScriptSecurity(script); err != nil {
|
||||
s.Errors = append(s.Errors, err.Error())
|
||||
} else {
|
||||
s.Security = sec
|
||||
svc.permissions = append(svc.permissions, rr...)
|
||||
}
|
||||
}
|
||||
|
||||
// Corredor can (by design) serve us script with errors (load, parse time) and
|
||||
// they need to be ignored by security, trigger, iterator handlers
|
||||
if len(s.Errors) == 0 {
|
||||
@ -468,15 +477,6 @@ func (svc *service) registerServerScripts(ss ...*ServerScript) {
|
||||
}
|
||||
}
|
||||
|
||||
if len(s.Errors) == 0 {
|
||||
if sec, rr, err := svc.serverScriptSecurity(script); err != nil {
|
||||
s.Errors = append(s.Errors, err.Error())
|
||||
} else {
|
||||
s.Security = sec
|
||||
svc.permissions = append(svc.permissions, rr...)
|
||||
}
|
||||
}
|
||||
|
||||
if len(s.Errors) == 0 {
|
||||
svc.log.Debug(
|
||||
"script registered",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user