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

FEAT #11996 TIME 0:30 hide disabled models unless parameter is provided

parent f5a58633
No related branches found
No related tags found
No related merge requests found
......@@ -32,9 +32,17 @@ class IndexingModelController
{
public function get(Request $request, Response $response)
{
$query = $request->getQueryParams();
$where = ['(owner = ? OR private = ?)'];
if (!ServiceModel::hasService(['id' => 'admin_indexing_models', 'userId' => $GLOBALS['userId'], 'location' => 'apps', 'type' => 'admin'])) {
$showDisabled = false;
if (Validator::notEmpty()->validate($query['showDisabled'])) {
$showDisabled = $query['showDisabled'] == 'true';
}
if (!$showDisabled) {
$where[] = 'enabled = TRUE';
} else if (!ServiceModel::hasService(['id' => 'admin_indexing_models', 'userId' => $GLOBALS['userId'], 'location' => 'apps', 'type' => 'admin'])) {
$where[] = 'enabled = TRUE';
}
......@@ -330,7 +338,7 @@ class IndexingModelController
}
$resources = ResModel::get([
'select' => ['1'],
'select' => [1],
'where' => ['model_id = ?'],
'data' => [$args['id']]
]);
......
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