Commit 16c4283d authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Débloquage de thèses, identité et de la recherche pour user

parent 206e3cd9
Loading
Loading
Loading
Loading
+8 −27
Changes for module/Application/config/others/these.config.php: 8 added lines, 27 removed lines.
Original line number Diff line number Diff line
@@ -76,33 +76,31 @@ return [
                [
                    'controller' => 'Application\Controller\These',
                    'action'     => [
                        'index',
                        'these',
                        'detail-identite',
                        'rechercher',
                        'depot-papier-final',
                    ],
                    'privileges' => ThesePrivileges::THESE_RECHERCHE,
                    'roles' => 'user',
                ],
                [
                    'controller' => 'Application\Controller\These',
                    'action'     => [
                        'filters',
                        'depot-papier-final',
                    ],
                    'roles' => 'guest',
                    'privileges' => ThesePrivileges::THESE_RECHERCHE,
                ],
                [
                    'controller' => 'Application\Controller\These',
                    'action'     => [
                        'index',
                    ],
                    'privileges' => [
                        ThesePrivileges::THESE_CONSULTATION_FICHE,
                        ThesePrivileges::THESE_CONSULTATION_TOUTES_THESES,
                        'filters',
                    ],
                    'roles' => 'guest',
                ],
                [
                    'controller' => 'Application\Controller\These',
                    'action'     => [
                        'roadmap',
                        'detail-identite',
                        'generate',
                        'fusion',
                        'validation-page-de-couverture',
@@ -128,7 +126,6 @@ return [
                        'detail-depot-version-corrigee',
                        'detail-fichiers',

                        'these',
                        'these-retraitee',
                        'annexes',
                        'attestation',
@@ -181,22 +178,6 @@ return [
                    'privileges' => ThesePrivileges::THESE_CONSULTATION_RDV_BU,
                    'assertion'  => 'Assertion\\These',
                ],
//                [ NB: ECLATÉ JUSTE APRÈS
//                    'controller' => 'Application\Controller\These',
//                    'action'     => [
//                        'modifier-description',
//                        'modifier-certif-conformite',
//                        'modifier-attestation',
//                        'modifier-diffusion',
//                        'modifier-rdv-bu',
//                    ],
//                    'privileges' => [
//                        ThesePrivileges::THESE_SAISIE_DESCRIPTION,
//                        ThesePrivileges::THESE_SAISIE_AUTORISATION_DIFFUSION,
//                        ThesePrivileges::THESE_DEPOT_VERSION_INITIALE,
//                    ],
//                    'assertion'  => 'Assertion\\These',
//                ],
                [
                    'controller' => 'Application\Controller\These',
                    'action'     => [
+11 −9
Changes for module/Application/src/Application/Controller/IndexController.php: 11 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -39,15 +39,17 @@ class IndexController extends AbstractController
//        $config = ($this->getServiceLocator()->get('config'));
//        $this->pretty_print($config);


        if ($this->identity() && count($this->userContextService->getSelectableIdentityRoles()) === 0) {
            // déconnexion applicative
            $this->zfcUserAuthentication()->getAuthAdapter()->resetAdapters();
            $this->zfcUserAuthentication()->getAuthAdapter()->logoutAdapters();
            $this->zfcUserAuthentication()->getAuthService()->clearIdentity();

            return $this->redirect()->toRoute('not-allowed');
        }
        /**
         * NB (2019/03/20) : désactiver pour donner l'accès à toutes les thèses pour les rôles doctorant et directeur/co-directeur
         */
//        if ($this->identity() && count($this->userContextService->getSelectableIdentityRoles()) === 0) {
//            // déconnexion applicative
//            $this->zfcUserAuthentication()->getAuthAdapter()->resetAdapters();
//            $this->zfcUserAuthentication()->getAuthAdapter()->logoutAdapters();
//            $this->zfcUserAuthentication()->getAuthService()->clearIdentity();
//
//            return $this->redirect()->toRoute('not-allowed');
//        }

        if (($response = $this->indexForSelectedRole()) instanceof Response) {
            return $response;
+7 −6
Changes for module/Application/src/Application/Service/These/TheseRechercheService.php: 7 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -506,11 +506,11 @@ class TheseRechercheService

    private function fetchEtablissementsOptions()
    {
        $privilege = StructurePrivileges::STRUCTURE_CONSULTATION_TOUTES_STRUCTURES;
        $toutesStructuresAllowed = $this->authorizeService->isAllowed(StructurePrivileges::getResourceId($privilege));
        if (!$toutesStructuresAllowed) {
        $role = $this->getSelectedIdentityRole();

        $privilege = StructurePrivileges::STRUCTURE_CONSULTATION_TOUTES_STRUCTURES;
        $toutesStructuresAllowed = $this->authorizeService->isAllowed(StructurePrivileges::getResourceId($privilege));
        if ($role && !$toutesStructuresAllowed) {
            return [
                $this->optionify($role->getStructure()->getEtablissement())
            ];
@@ -568,12 +568,13 @@ class TheseRechercheService
    {
        $role = $this->getSelectedIdentityRole();

        if ($role->isEtablissementDependant()) {
        if ($role && $role->isEtablissementDependant()) {
            $etablissement = $role->getStructure()->getEtablissement();
            $annees = $this->theseService->getRepository()->fetchDistinctAnneesPremiereInscription($etablissement);
        } else {
            $annees = $this->theseService->getRepository()->fetchDistinctAnneesPremiereInscription();
        }
        $annees = $this->theseService->getRepository()->fetchDistinctAnneesPremiereInscription();

        $annees = array_reverse(array_filter($annees));

@@ -591,7 +592,7 @@ class TheseRechercheService
        $role = $this->getSelectedIdentityRole();

        $etablissement = null;
        if ($role->isEtablissementDependant()) {
        if ($role && $role->isEtablissementDependant()) {
            $etablissement = $role->getStructure()->getEtablissement();
        }
        $annees = $this->theseService->getRepository()->fetchDistinctAnneesUniv1ereInscription($etablissement);
@@ -669,7 +670,7 @@ class TheseRechercheService
    {
        $role = $this->getSelectedIdentityRole();

        if ($role->isEtablissementDependant()) {
        if ($role && $role->isEtablissementDependant()) {
            $etablissement = $role->getStructure()->getEtablissement();
            $annees = $this->theseService->getRepository()->fetchDistinctAnneesSoutenance($etablissement);
        } else {