Loading doc/release-notes/v10/10.6.0/03_autorisation_inscr.sql 0 → 100644 +9 −0 Original line number Diff line number Diff line INSERT INTO public.unicaen_privilege_privilege (categorie_id, code, libelle, ordre) VALUES ((SELECT id FROM unicaen_privilege_categorie WHERE code = 'autorisation-inscription'), 'acceder-commentaires', 'Accéder aux commentaires saisis lors d''une autorisation d''inscription sur l''année suivante', 2); select privilege__grant_privileges_to_profiles('autorisation-inscription', ARRAY['acceder-commentaires'], ARRAY['GEST_ED', 'RESP_ED'] ); No newline at end of file module/Application/config/others/autorisation-inscription.config.php +1 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ return [ [ 'privileges' => [ AutorisationInscriptionPrivileges::AUTORISATION_INSCRIPTION_AJOUTER, AutorisationInscriptionPrivileges::AUTORISATION_INSCRIPTION_ACCEDER_COMMENTAIRES, ], 'resources' => ['AutorisationInscription'], 'assertion' => AutorisationInscriptionAssertion::class, Loading module/Application/src/Application/Assertion/AutorisationInscription/AutorisationInscriptionAssertion.php +6 −11 Original line number Diff line number Diff line Loading @@ -102,20 +102,15 @@ class AutorisationInscriptionAssertion extends AbstractAssertion implements User } try { $this->rapport = $this->autorisationInscription->getRapport(); $these = $this->rapport?->getThese(); switch ($privilege) { case AutorisationInscriptionPrivileges::AUTORISATION_INSCRIPTION_AJOUTER: if($this->autorisationInscription->getId()) return false; $this->rapport = $this->autorisationInscription->getRapport(); $these = $this->rapport?->getThese(); if ($roleEcoleDoctorale = $this->userContextService->getSelectedRoleEcoleDoctorale()) { $this->assertTrue( $these->getEcoleDoctorale()->getStructure()->getId() === $roleEcoleDoctorale->getStructure()->getId(), "La thèse n'est pas rattachée à l'ED " . $roleEcoleDoctorale->getStructure()->getCode() ); } return $this->canAjouterAutorisationInscription($these); return $this->userContextService->isStructureDuRoleRespecteeForThese($these) && $this->canAjouterAutorisationInscription($these); case AutorisationInscriptionPrivileges::AUTORISATION_INSCRIPTION_ACCEDER_COMMENTAIRES: return $this->userContextService->isStructureDuRoleRespecteeForThese($these); } } catch (FailedAssertionException $e) { Loading @@ -130,7 +125,7 @@ class AutorisationInscriptionAssertion extends AbstractAssertion implements User private function canAjouterAutorisationInscription(These $these): bool { //Si la thèse est importée, ne pas donner le droit de créer une autorisation d'inscription (pour l'instant) if($these->getSource()->getImportable()) return false; // if($these->getSource()->getImportable()) return false; $anneesInscriptionThese = array_map(function(TheseAnneeUniv $anneeUniv) { return $anneeUniv->getPremiereAnnee(); Loading module/Application/src/Application/Controller/AutorisationInscriptionController.php +6 −3 Original line number Diff line number Diff line Loading @@ -45,10 +45,13 @@ class AutorisationInscriptionController extends AbstractController $autorisationInscription = $form->getData(); if($autorisationInscription->getThese() && $autorisationInscription->getAutorisationInscription() === true){ //on agit sur la thèse seulement si la thèse n'est pas importée d'un système de scolarité (Apogée...) if($these->getSource()->getImportable()){ $theseAnneeUnivInscription = $this->theseAnneeUnivService->initFromAutorisationInscription($autorisationInscription); $these->addAnneesUnivInscription($theseAnneeUnivInscription); $this->theseService->saveThese($these); } } $this->autorisationInscriptionService->create($autorisationInscription); $this->flashMessenger()->addSuccessMessage("Avis concernant l'autorisation de réinscription pour l'année {$autorisationInscription->getAnneeUniv()->getAnneeUnivToString()} effectuée avec succès."); Loading module/Application/src/Application/Provider/Privilege/AutorisationInscriptionPrivileges.php +1 −0 Original line number Diff line number Diff line Loading @@ -7,4 +7,5 @@ use UnicaenPrivilege\Provider\Privilege\Privileges; class AutorisationInscriptionPrivileges extends Privileges { public const AUTORISATION_INSCRIPTION_AJOUTER = 'autorisation-inscription-ajouter'; public const AUTORISATION_INSCRIPTION_ACCEDER_COMMENTAIRES = 'autorisation-inscription-acceder-commentaires'; } Loading
doc/release-notes/v10/10.6.0/03_autorisation_inscr.sql 0 → 100644 +9 −0 Original line number Diff line number Diff line INSERT INTO public.unicaen_privilege_privilege (categorie_id, code, libelle, ordre) VALUES ((SELECT id FROM unicaen_privilege_categorie WHERE code = 'autorisation-inscription'), 'acceder-commentaires', 'Accéder aux commentaires saisis lors d''une autorisation d''inscription sur l''année suivante', 2); select privilege__grant_privileges_to_profiles('autorisation-inscription', ARRAY['acceder-commentaires'], ARRAY['GEST_ED', 'RESP_ED'] ); No newline at end of file
module/Application/config/others/autorisation-inscription.config.php +1 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ return [ [ 'privileges' => [ AutorisationInscriptionPrivileges::AUTORISATION_INSCRIPTION_AJOUTER, AutorisationInscriptionPrivileges::AUTORISATION_INSCRIPTION_ACCEDER_COMMENTAIRES, ], 'resources' => ['AutorisationInscription'], 'assertion' => AutorisationInscriptionAssertion::class, Loading
module/Application/src/Application/Assertion/AutorisationInscription/AutorisationInscriptionAssertion.php +6 −11 Original line number Diff line number Diff line Loading @@ -102,20 +102,15 @@ class AutorisationInscriptionAssertion extends AbstractAssertion implements User } try { $this->rapport = $this->autorisationInscription->getRapport(); $these = $this->rapport?->getThese(); switch ($privilege) { case AutorisationInscriptionPrivileges::AUTORISATION_INSCRIPTION_AJOUTER: if($this->autorisationInscription->getId()) return false; $this->rapport = $this->autorisationInscription->getRapport(); $these = $this->rapport?->getThese(); if ($roleEcoleDoctorale = $this->userContextService->getSelectedRoleEcoleDoctorale()) { $this->assertTrue( $these->getEcoleDoctorale()->getStructure()->getId() === $roleEcoleDoctorale->getStructure()->getId(), "La thèse n'est pas rattachée à l'ED " . $roleEcoleDoctorale->getStructure()->getCode() ); } return $this->canAjouterAutorisationInscription($these); return $this->userContextService->isStructureDuRoleRespecteeForThese($these) && $this->canAjouterAutorisationInscription($these); case AutorisationInscriptionPrivileges::AUTORISATION_INSCRIPTION_ACCEDER_COMMENTAIRES: return $this->userContextService->isStructureDuRoleRespecteeForThese($these); } } catch (FailedAssertionException $e) { Loading @@ -130,7 +125,7 @@ class AutorisationInscriptionAssertion extends AbstractAssertion implements User private function canAjouterAutorisationInscription(These $these): bool { //Si la thèse est importée, ne pas donner le droit de créer une autorisation d'inscription (pour l'instant) if($these->getSource()->getImportable()) return false; // if($these->getSource()->getImportable()) return false; $anneesInscriptionThese = array_map(function(TheseAnneeUniv $anneeUniv) { return $anneeUniv->getPremiereAnnee(); Loading
module/Application/src/Application/Controller/AutorisationInscriptionController.php +6 −3 Original line number Diff line number Diff line Loading @@ -45,10 +45,13 @@ class AutorisationInscriptionController extends AbstractController $autorisationInscription = $form->getData(); if($autorisationInscription->getThese() && $autorisationInscription->getAutorisationInscription() === true){ //on agit sur la thèse seulement si la thèse n'est pas importée d'un système de scolarité (Apogée...) if($these->getSource()->getImportable()){ $theseAnneeUnivInscription = $this->theseAnneeUnivService->initFromAutorisationInscription($autorisationInscription); $these->addAnneesUnivInscription($theseAnneeUnivInscription); $this->theseService->saveThese($these); } } $this->autorisationInscriptionService->create($autorisationInscription); $this->flashMessenger()->addSuccessMessage("Avis concernant l'autorisation de réinscription pour l'année {$autorisationInscription->getAnneeUniv()->getAnneeUnivToString()} effectuée avec succès."); Loading
module/Application/src/Application/Provider/Privilege/AutorisationInscriptionPrivileges.php +1 −0 Original line number Diff line number Diff line Loading @@ -7,4 +7,5 @@ use UnicaenPrivilege\Provider\Privilege\Privileges; class AutorisationInscriptionPrivileges extends Privileges { public const AUTORISATION_INSCRIPTION_AJOUTER = 'autorisation-inscription-ajouter'; public const AUTORISATION_INSCRIPTION_ACCEDER_COMMENTAIRES = 'autorisation-inscription-acceder-commentaires'; }