mirror of
https://github.com/Icinga/icinga2.git
synced 2026-02-03 20:40:17 -05:00
Check for permission in get_object()
This commit is contained in:
parent
61670d5f23
commit
07216bdf77
1 changed files with 9 additions and 1 deletions
|
|
@ -473,7 +473,15 @@ ConfigObject::Ptr ScriptUtils::GetObject(const Value& vtype, const String& name)
|
|||
if (!ctype)
|
||||
return nullptr;
|
||||
|
||||
return ctype->GetObject(name);
|
||||
auto cfgObj = ctype->GetObject(name);
|
||||
if (cfgObj) {
|
||||
auto* frame = ScriptFrame::GetCurrentFrame();
|
||||
if (frame->PermChecker->CanAccessConfigObject(cfgObj)) {
|
||||
return cfgObj;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Array::Ptr ScriptUtils::GetObjects(const Type::Ptr& type)
|
||||
|
|
|
|||
Loading…
Reference in a new issue