Skip to content
Snippets Groups Projects
Commit f964d7fd authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FEAT #17563 TIME 0:45 added get seda configuration route

parent fcf15cc6
No related branches found
No related tags found
No related merge requests found
......@@ -144,6 +144,7 @@ $app->get('/m2m/configuration', \Configuration\controllers\ConfigurationControll
$app->put('/m2m/configuration', \Configuration\controllers\ConfigurationController::class . ':updateM2MConfiguration');
$app->get('/watermark/configuration', \Configuration\controllers\ConfigurationController::class . ':getWatermarkConfiguration');
$app->put('/watermark/configuration', \Configuration\controllers\ConfigurationController::class . ':updateWatermarkConfiguration');
$app->get('/seda/configuration', \Configuration\controllers\ConfigurationController::class . ':getSedaExportConfiguration');
//Contacts
$app->get('/contacts', \Contact\controllers\ContactController::class . ':get');
......
......@@ -452,4 +452,21 @@ class ConfigurationController
return $response->withStatus(204);
}
public function getSedaExportConfiguration(Request $request, Response $response)
{
if (!PrivilegeController::hasPrivilege(['privilegeId' => 'admin_parameters', 'userId' => $GLOBALS['id']])) {
return $response->withStatus(403)->withJson(['errors' => 'Service forbidden']);
}
$config = CoreConfigModel::getJsonLoaded(['path' => CoreConfigModel::getConfigPath()]);
if (empty($config['exportSeda'])) {
return $response->withJson(['exportSeda' => []]);
}
$config = $config['exportSeda'];
unset($config['token']);
return $response->withJson(['exportSeda' => $config]);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment