Loading module/Application/config/others/these.config.php +13 −2 Changes for module/Application/config/others/these.config.php: 13 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -56,6 +56,10 @@ return [ ThesePrivileges::THESE_SAISIE_RDV_BU, ThesePrivileges::FICHIER_DIVERS_TELEVERSER, ThesePrivileges::FICHIER_DIVERS_CONSULTER, ThesePrivileges::THESE_CONSULTATION_TOUTES_THESES, ThesePrivileges::THESE_CONSULTATION_SES_THESES, ThesePrivileges::THESE_MODIFICATION_TOUTES_THESES, ThesePrivileges::THESE_MODIFICATION_SES_THESES, // ThesePrivileges::THESE_REFRESH, ], 'resources' => ['These'], Loading Loading @@ -86,7 +90,10 @@ return [ 'action' => [ 'index', ], 'privileges' => ThesePrivileges::THESE_CONSULTATION_FICHE, 'privileges' => [ ThesePrivileges::THESE_CONSULTATION_FICHE, ThesePrivileges::THESE_CONSULTATION_TOUTES_THESES, ], ], [ 'controller' => 'Application\Controller\These', Loading @@ -97,7 +104,11 @@ return [ 'fusion', 'validation-page-de-couverture', ], 'privileges' => ThesePrivileges::THESE_CONSULTATION_FICHE, 'privileges' => [ ThesePrivileges::THESE_CONSULTATION_FICHE, ThesePrivileges::THESE_CONSULTATION_TOUTES_THESES, ThesePrivileges::THESE_CONSULTATION_SES_THESES, ], 'assertion' => 'Assertion\\These', ], [ Loading module/Application/src/Application/Assertion/These/TheseAssertion.php +26 Changes for module/Application/src/Application/Assertion/These/TheseAssertion.php: 26 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Application\Assertion\These; use Application\Acl\WfEtapeResource; use Application\Assertion\BaseAssertion; use Application\Entity\Db\Role; use Application\Entity\Db\These; use Application\Entity\Db\WfEtape; use Application\Provider\Privilege\ThesePrivileges; Loading Loading @@ -33,6 +34,8 @@ class TheseAssertion extends BaseAssertion implements WorkflowServiceAwareInterf /** @var These $these */ $role = $this->userContextService->getSelectedIdentityRole(); $individu = $this->userContextService->getIdentityIndividu(); switch (true) { case $privilege === ThesePrivileges::THESE_SAISIE_DESCRIPTION_VERSION_INITIALE: return ! $this->isAllowed(new WfEtapeResource(WfEtape::CODE_DEPOT_VERSION_ORIGINALE_CORRIGEE, $these)); Loading @@ -40,6 +43,29 @@ class TheseAssertion extends BaseAssertion implements WorkflowServiceAwareInterf case $privilege === ValidationPrivileges::THESE_VALIDATION_RDV_BU: return $this->isAllowed(new WfEtapeResource(WfEtape::CODE_RDV_BU_VALIDATION_BU, $these)); break; case $privilege === ThesePrivileges::THESE_CONSULTATION_SES_THESES: case $privilege === ThesePrivileges::THESE_MODIFICATION_SES_THESES: // doctorant if ($role->getCode() === Role::CODE_DOCTORANT) return $these->getDoctorant()->getIndividu() === $individu; // directeur if ($role->getCode() === Role::CODE_DIRECTEUR_THESE) { $directeurs = $these->getActeursByRoleCode(Role::CODE_DIRECTEUR_THESE); $individus = []; foreach ($directeurs as $directeur) $individus[] = $directeur->getIndividu(); return (array_search($individu, $individus) !== false); } if ($role->getCode() === Role::CODE_CODIRECTEUR_THESE) { $directeurs = $these->getActeursByRoleCode(Role::CODE_CODIRECTEUR_THESE); $individus = []; foreach ($directeurs as $directeur) $individus[] = $directeur->getIndividu(); return (array_search($individu, $individus) !== false); } // structure if ($role->getCode() === Role::CODE_ED) return $these->getEcoleDoctorale()->getStructure() === $role->getStructure(); if ($role->getCode() === Role::CODE_UR) return $these->getUniteRecherche()->getStructure() === $role->getStructure(); if ($role->getCode() === Role::CODE_ADMIN || $role->getCode() === Role::CODE_BDD || $role->getCode() === Role::CODE_BU) return $these->getEtablissement()->getStructure() === $role->getStructure(); break; } return true; Loading module/Application/src/Application/Assertion/These/TheseControllerAssertion.php +3 −3 Changes for module/Application/src/Application/Assertion/These/TheseControllerAssertion.php: 3 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -55,9 +55,9 @@ class TheseControllerAssertion extends ControllerAssertion return false; } if (! $this->userContextService->isStructureDuRoleRespecteeForThese($this->these)) { return false; } // if (! $this->userContextService->isStructureDuRoleRespecteeForThese($this->these)) { // return false; // } return true; } Loading module/Application/src/Application/Service/These/TheseRechercheService.php +28 −28 Changes for module/Application/src/Application/Service/These/TheseRechercheService.php: 28 added lines, 28 removed lines. Original line number Diff line number Diff line Loading @@ -419,34 +419,34 @@ class TheseRechercheService // ... } elseif ($role->isStructureDependant()) { if ($role->isEtablissementDependant()) { /** * On ne voit que les thèses de son établissement. */ $qb ->andWhere('t.etablissement = :etab') ->setParameter('etab', $role->getStructure()->getEtablissement()); } elseif ($role->isEcoleDoctoraleDependant()) { /** * On ne voit que les thèses concernant son ED. */ $qb ->addSelect('ed2')->join('t.ecoleDoctorale', 'ed2') ->andWhere('ed2 = :ed') ->setParameter('ed', $role->getStructure()->getEcoleDoctorale()); } elseif ($role->isUniteRechercheDependant()) { /** * On ne voit que les thèses concernant son UR. */ $qb ->addSelect('ur2')->join('t.uniteRecherche', 'ur2') ->andWhere('ur2 = :ur') ->setParameter('ur', $role->getStructure()->getUniteRecherche()); } } // elseif ($role->isStructureDependant()) { // if ($role->isEtablissementDependant()) { // /** // * On ne voit que les thèses de son établissement. // */ // $qb // ->andWhere('t.etablissement = :etab') // ->setParameter('etab', $role->getStructure()->getEtablissement()); // } // elseif ($role->isEcoleDoctoraleDependant()) { // /** // * On ne voit que les thèses concernant son ED. // */ // $qb // ->addSelect('ed2')->join('t.ecoleDoctorale', 'ed2') // ->andWhere('ed2 = :ed') // ->setParameter('ed', $role->getStructure()->getEcoleDoctorale()); // } // elseif ($role->isUniteRechercheDependant()) { // /** // * On ne voit que les thèses concernant son UR. // */ // $qb // ->addSelect('ur2')->join('t.uniteRecherche', 'ur2') // ->andWhere('ur2 = :ur') // ->setParameter('ur', $role->getStructure()->getUniteRecherche()); // } // } } /** Loading module/Application/view/application/privilege/partial/form-filtrage.phtml +1 −3 Changes for module/Application/view/application/privilege/partial/form-filtrage.phtml: 1 added line, 3 removed lines. Original line number Diff line number Diff line Loading @@ -47,9 +47,7 @@ echo $this->filterPanel([ ['value' => $v = "these", 'label' => $this->translate("These") ], ['value' => $v = "utilisateur", 'label' => $this->translate("Utilisateur") ], ['value' => $v = "doctorant", 'label' => $this->translate("Doctorant") ], ['value' => $v = "etablissement", 'label' => $this->translate("Établissement") ], ['value' => $v = "ecole-doctorale", 'label' => $this->translate("École doctorale") ], ['value' => $v = "unite-recherche", 'label' => $this->translate("Unité de recherche") ], ['value' => $v = "structure", 'label' => $this->translate("Structure") ], ['value' => $v = "indicateur", 'label' => $this->translate("Indicateur") ], ['value' => $v = "substitution", 'label' => $this->translate("Substitution") ], ['value' => $v = "validation", 'label' => $this->translate("Validation") ], Loading Loading
module/Application/config/others/these.config.php +13 −2 Changes for module/Application/config/others/these.config.php: 13 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -56,6 +56,10 @@ return [ ThesePrivileges::THESE_SAISIE_RDV_BU, ThesePrivileges::FICHIER_DIVERS_TELEVERSER, ThesePrivileges::FICHIER_DIVERS_CONSULTER, ThesePrivileges::THESE_CONSULTATION_TOUTES_THESES, ThesePrivileges::THESE_CONSULTATION_SES_THESES, ThesePrivileges::THESE_MODIFICATION_TOUTES_THESES, ThesePrivileges::THESE_MODIFICATION_SES_THESES, // ThesePrivileges::THESE_REFRESH, ], 'resources' => ['These'], Loading Loading @@ -86,7 +90,10 @@ return [ 'action' => [ 'index', ], 'privileges' => ThesePrivileges::THESE_CONSULTATION_FICHE, 'privileges' => [ ThesePrivileges::THESE_CONSULTATION_FICHE, ThesePrivileges::THESE_CONSULTATION_TOUTES_THESES, ], ], [ 'controller' => 'Application\Controller\These', Loading @@ -97,7 +104,11 @@ return [ 'fusion', 'validation-page-de-couverture', ], 'privileges' => ThesePrivileges::THESE_CONSULTATION_FICHE, 'privileges' => [ ThesePrivileges::THESE_CONSULTATION_FICHE, ThesePrivileges::THESE_CONSULTATION_TOUTES_THESES, ThesePrivileges::THESE_CONSULTATION_SES_THESES, ], 'assertion' => 'Assertion\\These', ], [ Loading
module/Application/src/Application/Assertion/These/TheseAssertion.php +26 Changes for module/Application/src/Application/Assertion/These/TheseAssertion.php: 26 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Application\Assertion\These; use Application\Acl\WfEtapeResource; use Application\Assertion\BaseAssertion; use Application\Entity\Db\Role; use Application\Entity\Db\These; use Application\Entity\Db\WfEtape; use Application\Provider\Privilege\ThesePrivileges; Loading Loading @@ -33,6 +34,8 @@ class TheseAssertion extends BaseAssertion implements WorkflowServiceAwareInterf /** @var These $these */ $role = $this->userContextService->getSelectedIdentityRole(); $individu = $this->userContextService->getIdentityIndividu(); switch (true) { case $privilege === ThesePrivileges::THESE_SAISIE_DESCRIPTION_VERSION_INITIALE: return ! $this->isAllowed(new WfEtapeResource(WfEtape::CODE_DEPOT_VERSION_ORIGINALE_CORRIGEE, $these)); Loading @@ -40,6 +43,29 @@ class TheseAssertion extends BaseAssertion implements WorkflowServiceAwareInterf case $privilege === ValidationPrivileges::THESE_VALIDATION_RDV_BU: return $this->isAllowed(new WfEtapeResource(WfEtape::CODE_RDV_BU_VALIDATION_BU, $these)); break; case $privilege === ThesePrivileges::THESE_CONSULTATION_SES_THESES: case $privilege === ThesePrivileges::THESE_MODIFICATION_SES_THESES: // doctorant if ($role->getCode() === Role::CODE_DOCTORANT) return $these->getDoctorant()->getIndividu() === $individu; // directeur if ($role->getCode() === Role::CODE_DIRECTEUR_THESE) { $directeurs = $these->getActeursByRoleCode(Role::CODE_DIRECTEUR_THESE); $individus = []; foreach ($directeurs as $directeur) $individus[] = $directeur->getIndividu(); return (array_search($individu, $individus) !== false); } if ($role->getCode() === Role::CODE_CODIRECTEUR_THESE) { $directeurs = $these->getActeursByRoleCode(Role::CODE_CODIRECTEUR_THESE); $individus = []; foreach ($directeurs as $directeur) $individus[] = $directeur->getIndividu(); return (array_search($individu, $individus) !== false); } // structure if ($role->getCode() === Role::CODE_ED) return $these->getEcoleDoctorale()->getStructure() === $role->getStructure(); if ($role->getCode() === Role::CODE_UR) return $these->getUniteRecherche()->getStructure() === $role->getStructure(); if ($role->getCode() === Role::CODE_ADMIN || $role->getCode() === Role::CODE_BDD || $role->getCode() === Role::CODE_BU) return $these->getEtablissement()->getStructure() === $role->getStructure(); break; } return true; Loading
module/Application/src/Application/Assertion/These/TheseControllerAssertion.php +3 −3 Changes for module/Application/src/Application/Assertion/These/TheseControllerAssertion.php: 3 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -55,9 +55,9 @@ class TheseControllerAssertion extends ControllerAssertion return false; } if (! $this->userContextService->isStructureDuRoleRespecteeForThese($this->these)) { return false; } // if (! $this->userContextService->isStructureDuRoleRespecteeForThese($this->these)) { // return false; // } return true; } Loading
module/Application/src/Application/Service/These/TheseRechercheService.php +28 −28 Changes for module/Application/src/Application/Service/These/TheseRechercheService.php: 28 added lines, 28 removed lines. Original line number Diff line number Diff line Loading @@ -419,34 +419,34 @@ class TheseRechercheService // ... } elseif ($role->isStructureDependant()) { if ($role->isEtablissementDependant()) { /** * On ne voit que les thèses de son établissement. */ $qb ->andWhere('t.etablissement = :etab') ->setParameter('etab', $role->getStructure()->getEtablissement()); } elseif ($role->isEcoleDoctoraleDependant()) { /** * On ne voit que les thèses concernant son ED. */ $qb ->addSelect('ed2')->join('t.ecoleDoctorale', 'ed2') ->andWhere('ed2 = :ed') ->setParameter('ed', $role->getStructure()->getEcoleDoctorale()); } elseif ($role->isUniteRechercheDependant()) { /** * On ne voit que les thèses concernant son UR. */ $qb ->addSelect('ur2')->join('t.uniteRecherche', 'ur2') ->andWhere('ur2 = :ur') ->setParameter('ur', $role->getStructure()->getUniteRecherche()); } } // elseif ($role->isStructureDependant()) { // if ($role->isEtablissementDependant()) { // /** // * On ne voit que les thèses de son établissement. // */ // $qb // ->andWhere('t.etablissement = :etab') // ->setParameter('etab', $role->getStructure()->getEtablissement()); // } // elseif ($role->isEcoleDoctoraleDependant()) { // /** // * On ne voit que les thèses concernant son ED. // */ // $qb // ->addSelect('ed2')->join('t.ecoleDoctorale', 'ed2') // ->andWhere('ed2 = :ed') // ->setParameter('ed', $role->getStructure()->getEcoleDoctorale()); // } // elseif ($role->isUniteRechercheDependant()) { // /** // * On ne voit que les thèses concernant son UR. // */ // $qb // ->addSelect('ur2')->join('t.uniteRecherche', 'ur2') // ->andWhere('ur2 = :ur') // ->setParameter('ur', $role->getStructure()->getUniteRecherche()); // } // } } /** Loading
module/Application/view/application/privilege/partial/form-filtrage.phtml +1 −3 Changes for module/Application/view/application/privilege/partial/form-filtrage.phtml: 1 added line, 3 removed lines. Original line number Diff line number Diff line Loading @@ -47,9 +47,7 @@ echo $this->filterPanel([ ['value' => $v = "these", 'label' => $this->translate("These") ], ['value' => $v = "utilisateur", 'label' => $this->translate("Utilisateur") ], ['value' => $v = "doctorant", 'label' => $this->translate("Doctorant") ], ['value' => $v = "etablissement", 'label' => $this->translate("Établissement") ], ['value' => $v = "ecole-doctorale", 'label' => $this->translate("École doctorale") ], ['value' => $v = "unite-recherche", 'label' => $this->translate("Unité de recherche") ], ['value' => $v = "structure", 'label' => $this->translate("Structure") ], ['value' => $v = "indicateur", 'label' => $this->translate("Indicateur") ], ['value' => $v = "substitution", 'label' => $this->translate("Substitution") ], ['value' => $v = "validation", 'label' => $this->translate("Validation") ], Loading