mirror of
https://github.com/Icinga/icinga2.git
synced 2025-11-09 00:10:19 +01:00
Check for permission in get_object()
This commit is contained in:
parent
61670d5f23
commit
07216bdf77
@ -473,7 +473,15 @@ ConfigObject::Ptr ScriptUtils::GetObject(const Value& vtype, const String& name)
|
|||||||
if (!ctype)
|
if (!ctype)
|
||||||
return nullptr;
|
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)
|
Array::Ptr ScriptUtils::GetObjects(const Type::Ptr& type)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user