MCPcopy Create free account
hub / github.com/Icinga/icinga2 / CanAccessObject

Method CanAccessObject

lib/remote/zone.cpp:91–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91bool Zone::CanAccessObject(const ConfigObject::Ptr& object)
92{
93 Zone::Ptr object_zone;
94
95 if (object->GetReflectionType() == Zone::TypeInstance)
96 object_zone = static_pointer_cast<Zone>(object);
97 else
98 object_zone = static_pointer_cast<Zone>(object->GetZone());
99
100 if (!object_zone)
101 object_zone = Zone::GetLocalZone();
102
103 if (object_zone->GetGlobal())
104 return true;
105
106 return object_zone->IsChildOf(this);
107}
108
109bool Zone::IsChildOf(const Zone::Ptr& zone)
110{

Calls 3

IsChildOfMethod · 0.80
GetReflectionTypeMethod · 0.45
GetZoneMethod · 0.45

Tested by

no test coverage detected