diff --git a/rest/index.php b/rest/index.php index 23194a8459cfc8e549b9a67746e4583a4c0729e5..73852a21f63ca9fbf21958c55e4e0fb3a52677fa 100755 --- a/rest/index.php +++ b/rest/index.php @@ -64,9 +64,6 @@ $app->post('/actions', \Action\controllers\ActionController::class . ':create'); $app->put('/actions/{id}', \Action\controllers\ActionController::class . ':update'); $app->delete('/actions/{id}', \Action\controllers\ActionController::class . ':delete'); -//Administration -$app->get('/administration', \SrcCore\controllers\CoreController::class . ':getAdministration'); - //Attachments $app->post('/attachments', \Attachment\controllers\AttachmentController::class . ':create'); $app->get('/attachments/{id}/content', \Attachment\controllers\AttachmentController::class . ':getFileContent'); @@ -229,7 +226,6 @@ $app->get('/histories/resources/workflow/{resId}', \History\controllers\HistoryC //Header $app->get('/header', \SrcCore\controllers\CoreController::class . ':getHeader'); -$app->get('/shortcuts', \SrcCore\controllers\CoreController::class . ':getShortcuts'); //Home $app->get('/home', \Home\controllers\HomeController::class . ':get'); diff --git a/src/core/controllers/CoreController.php b/src/core/controllers/CoreController.php index 67036258e4b263aee9f87618f26d6e8fb165d13c..b1da691a16c88850811379a5eed1cab82347f1e6 100755 --- a/src/core/controllers/CoreController.php +++ b/src/core/controllers/CoreController.php @@ -88,56 +88,6 @@ class CoreController ]); } - public function getShortcuts(Request $request, Response $response) - { - $shortcuts = [ - ['id' => 'home'] - ]; - - if (ServiceController::hasPrivilege(['privilegeId' => 'admin', 'userId' => $GLOBALS['id']])) { - $shortcuts[] = ['id' => 'administration']; - } - if (ServiceController::hasPrivilege(['privilegeId' => 'adv_search_mlb', 'userId' => $GLOBALS['id']])) { - $shortcuts[] = ['id' => 'search']; - } - - $indexingGroups = []; - $userGroups = UserModel::getGroupsByUser(['id' => $GLOBALS['id']]); - foreach ($userGroups as $group) { - if ($group['can_index']) { - $indexingGroups[] = ['id' => $group['id'], 'label' => $group['group_desc']]; - } - } - if (!empty($indexingGroups)) { - $shortcuts[] = [ - 'id' => 'indexing', - 'groups' => $indexingGroups - ]; - } - - return $response->withJson(['shortcuts' => $shortcuts]); - } - - public function getAdministration(Request $request, Response $response) - { - if (!ServiceController::hasPrivilege(['privilegeId' => 'admin', 'userId' => $GLOBALS['id']])) { - return $response->withStatus(403)->withJson(['errors' => 'Service forbidden']); - } - - if ($GLOBALS['userId'] == 'superadmin') { - $administration = []; - $administrationApplication = ServiceModel::getApplicationServicesByXML(['type' => 'admin']); - $administrationModule = ServiceModel::getModulesServicesByXML(['type' => 'admin']); - $administration['administrations'] = array_merge_recursive($administrationApplication, $administrationModule); -// $administration = ServiceController::PRIVILEGE_MENU; - } else { - $administration = ServiceModel::getAdministrationServicesByUserId(['userId' => $GLOBALS['userId']]); -// $administration = ServiceController::getAdministrationPrivilegesByUserId(['userId' => $GLOBALS['id']]); - } - - return $response->withJson($administration); - } - public static function setGlobals(array $args) { ValidatorModel::notEmpty($args, ['login']);