Check for permission in get_object()

This commit is contained in:
Johannes Schmidt 2025-09-22 12:26:03 +02:00
parent 61670d5f23
commit 07216bdf77

View File

@ -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)