| 461 | } |
| 462 | |
| 463 | ConfigObject::Ptr ScriptUtils::GetObject(const Value& vtype, const String& name) |
| 464 | { |
| 465 | Type::Ptr ptype; |
| 466 | |
| 467 | if (vtype.IsObjectType<Type>()) |
| 468 | ptype = vtype; |
| 469 | else |
| 470 | ptype = Type::GetByName(vtype); |
| 471 | |
| 472 | auto *ctype = dynamic_cast<ConfigType *>(ptype.get()); |
| 473 | |
| 474 | if (!ctype) |
| 475 | return nullptr; |
| 476 | |
| 477 | auto cfgObj = ctype->GetObject(name); |
| 478 | if (cfgObj) { |
| 479 | auto* frame = ScriptFrame::GetCurrentFrame(); |
| 480 | if (frame->PermChecker->CanAccessConfigObject(cfgObj)) { |
| 481 | return cfgObj; |
| 482 | } |
| 483 | } |
| 484 | |
| 485 | return nullptr; |
| 486 | } |
| 487 | |
| 488 | Array::Ptr ScriptUtils::GetObjects(const Type::Ptr& type) |
| 489 | { |
nothing calls this directly
no test coverage detected