mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-06 13:24:28 +02:00
parent
63055eb441
commit
356c4cc170
@ -66,9 +66,23 @@ String ConfigObjectUtility::CreateObjectConfig(const Type::Ptr& type, const Stri
|
|||||||
|
|
||||||
Dictionary::Ptr allAttrs = new Dictionary();
|
Dictionary::Ptr allAttrs = new Dictionary();
|
||||||
|
|
||||||
if (attrs)
|
if (attrs) {
|
||||||
attrs->CopyTo(allAttrs);
|
attrs->CopyTo(allAttrs);
|
||||||
|
|
||||||
|
ObjectLock olock(attrs);
|
||||||
|
BOOST_FOREACH(const Dictionary::Pair& kv, attrs) {
|
||||||
|
int fid = type->GetFieldId(kv.first);
|
||||||
|
|
||||||
|
if (fid < 0)
|
||||||
|
BOOST_THROW_EXCEPTION(ScriptError("Invalid attribute specified: " + kv.first));
|
||||||
|
|
||||||
|
Field field = type->GetFieldInfo(fid);
|
||||||
|
|
||||||
|
if (field.Attributes & FANoUserModify)
|
||||||
|
BOOST_THROW_EXCEPTION(ScriptError("Attribute is marked for internal use only and may not be set: " + kv.first));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (nameParts)
|
if (nameParts)
|
||||||
nameParts->CopyTo(allAttrs);
|
nameParts->CopyTo(allAttrs);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user