MCPcopy Create free account
hub / github.com/MITK/MITK / HandleGET_config_file_access

Method HandleGET_config_file_access

Modules/RESTAPI/src/mitkHealthController.cpp:96–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96void HealthController::HandleGET_config_file_access(const httplib::Request& /*req*/, httplib::Response& res)
97{
98 std::lock_guard<std::mutex> lock(m_Mutex);
99
100 const bool restrictionsActive = (m_FileAccessMode == FileAccessMode::AllowedDirectories);
101
102 nlohmann::json data;
103 data["mode"] = restrictionsActive ? "allowed-directories" : "unrestricted";
104 data["restrictions_active"] = restrictionsActive;
105
106 if (restrictionsActive)
107 {
108 data["allowed_paths"] = m_AllowedFileDirectories;
109 }
110
111 data["max_active_temp_dirs_per_ip"] = m_MaxActiveTempDirsPerIp;
112
113 nlohmann::json response;
114 response["data"] = data;
115
116 res.status = 200;
117 res.set_content(response.dump(), "application/json");
118}
119
120}

Calls

no outgoing calls