diff --git a/lib/remote/zone.cpp b/lib/remote/zone.cpp index da4a5dad3..e2b6d3a9b 100644 --- a/lib/remote/zone.cpp +++ b/lib/remote/zone.cpp @@ -20,6 +20,7 @@ #include "remote/zone.hpp" #include "remote/zone-ti.cpp" #include "remote/jsonrpcconnection.hpp" +#include "base/array.hpp" #include "base/objectlock.hpp" #include "base/logger.hpp" @@ -94,6 +95,16 @@ std::vector Zone::GetAllParentsRaw() const return m_AllParents; } +Array::Ptr Zone::GetAllParents() const +{ + auto result (new Array); + + for (auto& parent : m_AllParents) + result->Add(parent->GetName()); + + return result; +} + bool Zone::CanAccessObject(const ConfigObject::Ptr& object) { Zone::Ptr object_zone; diff --git a/lib/remote/zone.hpp b/lib/remote/zone.hpp index 23b04e6dd..8573131c5 100644 --- a/lib/remote/zone.hpp +++ b/lib/remote/zone.hpp @@ -41,6 +41,7 @@ public: Zone::Ptr GetParent() const; std::set GetEndpoints() const; std::vector GetAllParentsRaw() const; + Array::Ptr GetAllParents() const override; bool CanAccessObject(const ConfigObject::Ptr& object); bool IsChildOf(const Zone::Ptr& zone); diff --git a/lib/remote/zone.ti b/lib/remote/zone.ti index ad7bb8d50..638858036 100644 --- a/lib/remote/zone.ti +++ b/lib/remote/zone.ti @@ -34,6 +34,9 @@ class Zone : ConfigObject [config] array(name(Endpoint)) endpoints (EndpointsRaw); [config] bool global; + [no_user_modify, no_storage] array(Value) all_parents { + get; + }; }; }