diff --git a/lib/core/include/irods/irods_server_properties.hpp b/lib/core/include/irods/irods_server_properties.hpp index 804842e814..b1a06bb4f5 100644 --- a/lib/core/include/irods/irods_server_properties.hpp +++ b/lib/core/include/irods/irods_server_properties.hpp @@ -243,6 +243,21 @@ namespace irods return irods::server_properties::instance().contains(_prop); } + template + T get_advanced_setting_or_default(const std::string_view _prop, const T& _default) + { + auto config_handle = irods::server_properties::instance().map(); + const auto& config = config_handle.get_json(); + + if (const auto adv_iter = config.find("advanced_settings"); adv_iter != std::end(config)) { + if (const auto val_iter = adv_iter->find(_prop); val_iter != std::end(*adv_iter)) { + return val_iter->get(); + } + } + + return _default; + } + template< typename T > T get_server_property( const std::string& _prop ) {