Loading CHANGELOG.md +8 −0 Original line number Diff line number Diff line Journal des modifications ========================= 2.0.0 ------------------ - Passage à Zend Framework 3 et PHP 7.3 (gain de performances). - Listes de diffusion Sympa : page d'activation/désactivation des listes pour lesquelles SyGAL peut fournir les abonnés et les proopriétaires via une URL. - Nouveau rôle 'Authentifié(e)' permettant d'ajuster les privilèges d'un simple utilisateur authentifié. 1.4.9 (08/09/2020) ------------------ Loading doc/release-notes/v2.0.0.md 0 → 100644 +90 −0 Original line number Diff line number Diff line # Version 2.0.0 ## 1. Sur le serveur d'application - ATTENTION : l'application requiert désormais PHP 7.3. Vous devez donc mettre à jour la version de PHP (module Apache/FPM, et CLI) installée sur votre serveur. - Ensuite, placez-vous dans le répertoire de l'application puis lancez la commande suivante pour installer la nouvelle version de SyGAL : ```bash git fetch --tags && git checkout --force 2.0.0 && \ bash ./install.sh ``` - Selon le moteur PHP que vous avez installé, rechargez le service, exemple : - php7.3-fpm : `service php7.3-fpm reload` - apache2-mod-php7.3 : `service apache2 reload` ## 2. Dans la base de données ```sql -- -- Nouveau rôle 'Authentifié·e'. -- INSERT INTO ROLE (id, CODE, LIBELLE, SOURCE_CODE, SOURCE_ID, ROLE_ID, IS_DEFAULT, ATTRIB_AUTO, THESE_DEP, HISTO_CREATEUR_ID, HISTO_MODIFICATEUR_ID, ORDRE_AFFICHAGE) VALUES (role_id_seq.nextval, 'user', 'Authentifié·e', 'user', 1, 'user', 0, 0, 0, 1, 1, 'a'); -- -- Nouveau privilège 'consultation-page-couverture'. -- INSERT INTO PRIVILEGE (ID, CATEGORIE_ID, CODE, LIBELLE, ORDRE) VALUES (PRIVILEGE_id_seq.nextval, 3, 'consultation-page-couverture', 'Consultation de la page de couverture', 3026); -- -- Associations de privilèges à des profils. -- INSERT INTO PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID) with data(categ, priv) as ( select 'these', 'consultation-page-couverture' from dual /*union select 'xxxxx', 'xxx' from dual*/ ) select p.id as PRIVILEGE_ID, profil.id as PROFIL_ID from data join PROFIL on profil.ROLE_ID in ( 'ADMIN_TECH', 'BDD', 'BU', 'D', 'DOCTORANT', 'K', 'M', 'R', 'ED', 'UR' ) join CATEGORIE_PRIVILEGE cp on cp.CODE = data.categ join PRIVILEGE p on p.CATEGORIE_ID = cp.id and p.code = data.priv where not exists ( select * from PROFIL_PRIVILEGE where PRIVILEGE_ID = p.id and PROFIL_ID = profil.id ) ; -- -- Affectation de profils à des rôles. -- NB: penser à créer ensuite les ROLE_PRIVILEGE. -- insert into PROFIL_TO_ROLE (PROFIL_ID, ROLE_ID) with data(PROFIL_CODE, ROLE_ROLE_ID) as ( select 'BDD', 'Maison du doctorat UCN' from dual union select 'BDD', 'Maison du doctorat URN' from dual union select 'BDD', 'Maison du doctorat ULHN' from dual union select 'BDD', 'Maison du doctorat INSA' from dual ) select pr.id, r.id from data join PROFIL pr on pr.ROLE_ID = data.PROFIL_CODE join role r on r.ROLE_ID = data.ROLE_ROLE_ID where not exists ( select * from PROFIL_TO_ROLE where PROFIL_ID = pr.id and ROLE_ID = r.id ) ; -- -- Attribution automatique des privilèges aux rôles (ROLE_PRIVILEGE) tel que spécifié dans : -- - PROFIL_TO_ROLE (profils appliqués à chaque rôle) et -- - PROFIL_PRIVILEGE (privilèges accordés à chaque profil). -- insert into ROLE_PRIVILEGE (ROLE_ID, PRIVILEGE_ID) select p2r.ROLE_ID, pp.PRIVILEGE_ID from PROFIL_TO_ROLE p2r join profil pr on pr.id = p2r.PROFIL_ID join PROFIL_PRIVILEGE pp on pp.PROFIL_ID = pr.id where not exists ( select * from role_privilege where role_id = p2r.role_id and privilege_id = pp.privilege_id ) ; ``` module/Application/config/others/these.config.php +10 −1 Original line number Diff line number Diff line Loading @@ -130,7 +130,6 @@ return [ 'roadmap', 'generate', 'fusion', 'validation-page-de-couverture', ], 'privileges' => [ ThesePrivileges::THESE_CONSULTATION_FICHE, Loading Loading @@ -179,6 +178,16 @@ return [ 'privileges' => ThesePrivileges::THESE_FICHIER_DIVERS_CONSULTER, 'assertion' => 'Assertion\\These', ], [ 'controller' => 'Application\Controller\These', 'action' => [ 'validation-page-de-couverture', ], 'privileges' => [ ThesePrivileges::THESE_CONSULTATION_PAGE_COUVERTURE, ], 'assertion' => 'Assertion\\These', ], [ 'controller' => 'Application\Controller\These', 'action' => [ Loading module/Application/src/Application/Entity/Db/Role.php +2 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,8 @@ class Role extends AbstractRole implements SourceAwareInterface, HistoriqueAware const CODE_ED = 'ED'; const CODE_UR = 'UR'; const ROLE_ID_USER = 'user'; // ROLE_ID du rôle correspondant à un utilisateur authentifié avec succès. // @todo NB: maintenant il y le code étab concaténé au "role_id" const ROLE_ID_DOCTORANT = "Doctorant"; const ROLE_ID_BUREAU_DES_DOCTORATS = "Maison du doctorat"; Loading module/Application/src/Application/Provider/IdentityProvider.php +8 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ use Application\Service\UniteRecherche\UniteRechercheServiceAwareTrait; use Application\Service\Utilisateur\UtilisateurServiceAwareTrait; use Application\SourceCodeStringHelperAwareTrait; use BjyAuthorize\Provider\Identity\ProviderInterface; use UnicaenAuth\Acl\NamedRole; use UnicaenAuth\Provider\Identity\ChainableProvider; use UnicaenAuth\Provider\Identity\ChainEvent; use Zend\Authentication\AuthenticationService; Loading Loading @@ -91,10 +92,14 @@ class IdentityProvider implements ProviderInterface, ChainableProvider return []; } $this->roles = array_merge([], $this->getRolesFromActeur(), $roleAuthentifie = $this->roleService->getRepository()->findByCode('user')/*->setLibelle("coucou")*/; $this->roles = array_merge( [$roleAuthentifie], // $this->getRolesFromActeur(), $this->getRolesFromIndividuRole(), $this->getRolesFromDoctorant()); // $this->getRolesFromDoctorant() ); // Lignes mises en commentaire car revient à considérer le rôle "BdD UCN" identique au rôle "BdD URN" ! // La question est: pourquoi avoir fait ça ? Loading Loading
CHANGELOG.md +8 −0 Original line number Diff line number Diff line Journal des modifications ========================= 2.0.0 ------------------ - Passage à Zend Framework 3 et PHP 7.3 (gain de performances). - Listes de diffusion Sympa : page d'activation/désactivation des listes pour lesquelles SyGAL peut fournir les abonnés et les proopriétaires via une URL. - Nouveau rôle 'Authentifié(e)' permettant d'ajuster les privilèges d'un simple utilisateur authentifié. 1.4.9 (08/09/2020) ------------------ Loading
doc/release-notes/v2.0.0.md 0 → 100644 +90 −0 Original line number Diff line number Diff line # Version 2.0.0 ## 1. Sur le serveur d'application - ATTENTION : l'application requiert désormais PHP 7.3. Vous devez donc mettre à jour la version de PHP (module Apache/FPM, et CLI) installée sur votre serveur. - Ensuite, placez-vous dans le répertoire de l'application puis lancez la commande suivante pour installer la nouvelle version de SyGAL : ```bash git fetch --tags && git checkout --force 2.0.0 && \ bash ./install.sh ``` - Selon le moteur PHP que vous avez installé, rechargez le service, exemple : - php7.3-fpm : `service php7.3-fpm reload` - apache2-mod-php7.3 : `service apache2 reload` ## 2. Dans la base de données ```sql -- -- Nouveau rôle 'Authentifié·e'. -- INSERT INTO ROLE (id, CODE, LIBELLE, SOURCE_CODE, SOURCE_ID, ROLE_ID, IS_DEFAULT, ATTRIB_AUTO, THESE_DEP, HISTO_CREATEUR_ID, HISTO_MODIFICATEUR_ID, ORDRE_AFFICHAGE) VALUES (role_id_seq.nextval, 'user', 'Authentifié·e', 'user', 1, 'user', 0, 0, 0, 1, 1, 'a'); -- -- Nouveau privilège 'consultation-page-couverture'. -- INSERT INTO PRIVILEGE (ID, CATEGORIE_ID, CODE, LIBELLE, ORDRE) VALUES (PRIVILEGE_id_seq.nextval, 3, 'consultation-page-couverture', 'Consultation de la page de couverture', 3026); -- -- Associations de privilèges à des profils. -- INSERT INTO PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID) with data(categ, priv) as ( select 'these', 'consultation-page-couverture' from dual /*union select 'xxxxx', 'xxx' from dual*/ ) select p.id as PRIVILEGE_ID, profil.id as PROFIL_ID from data join PROFIL on profil.ROLE_ID in ( 'ADMIN_TECH', 'BDD', 'BU', 'D', 'DOCTORANT', 'K', 'M', 'R', 'ED', 'UR' ) join CATEGORIE_PRIVILEGE cp on cp.CODE = data.categ join PRIVILEGE p on p.CATEGORIE_ID = cp.id and p.code = data.priv where not exists ( select * from PROFIL_PRIVILEGE where PRIVILEGE_ID = p.id and PROFIL_ID = profil.id ) ; -- -- Affectation de profils à des rôles. -- NB: penser à créer ensuite les ROLE_PRIVILEGE. -- insert into PROFIL_TO_ROLE (PROFIL_ID, ROLE_ID) with data(PROFIL_CODE, ROLE_ROLE_ID) as ( select 'BDD', 'Maison du doctorat UCN' from dual union select 'BDD', 'Maison du doctorat URN' from dual union select 'BDD', 'Maison du doctorat ULHN' from dual union select 'BDD', 'Maison du doctorat INSA' from dual ) select pr.id, r.id from data join PROFIL pr on pr.ROLE_ID = data.PROFIL_CODE join role r on r.ROLE_ID = data.ROLE_ROLE_ID where not exists ( select * from PROFIL_TO_ROLE where PROFIL_ID = pr.id and ROLE_ID = r.id ) ; -- -- Attribution automatique des privilèges aux rôles (ROLE_PRIVILEGE) tel que spécifié dans : -- - PROFIL_TO_ROLE (profils appliqués à chaque rôle) et -- - PROFIL_PRIVILEGE (privilèges accordés à chaque profil). -- insert into ROLE_PRIVILEGE (ROLE_ID, PRIVILEGE_ID) select p2r.ROLE_ID, pp.PRIVILEGE_ID from PROFIL_TO_ROLE p2r join profil pr on pr.id = p2r.PROFIL_ID join PROFIL_PRIVILEGE pp on pp.PROFIL_ID = pr.id where not exists ( select * from role_privilege where role_id = p2r.role_id and privilege_id = pp.privilege_id ) ; ```
module/Application/config/others/these.config.php +10 −1 Original line number Diff line number Diff line Loading @@ -130,7 +130,6 @@ return [ 'roadmap', 'generate', 'fusion', 'validation-page-de-couverture', ], 'privileges' => [ ThesePrivileges::THESE_CONSULTATION_FICHE, Loading Loading @@ -179,6 +178,16 @@ return [ 'privileges' => ThesePrivileges::THESE_FICHIER_DIVERS_CONSULTER, 'assertion' => 'Assertion\\These', ], [ 'controller' => 'Application\Controller\These', 'action' => [ 'validation-page-de-couverture', ], 'privileges' => [ ThesePrivileges::THESE_CONSULTATION_PAGE_COUVERTURE, ], 'assertion' => 'Assertion\\These', ], [ 'controller' => 'Application\Controller\These', 'action' => [ Loading
module/Application/src/Application/Entity/Db/Role.php +2 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,8 @@ class Role extends AbstractRole implements SourceAwareInterface, HistoriqueAware const CODE_ED = 'ED'; const CODE_UR = 'UR'; const ROLE_ID_USER = 'user'; // ROLE_ID du rôle correspondant à un utilisateur authentifié avec succès. // @todo NB: maintenant il y le code étab concaténé au "role_id" const ROLE_ID_DOCTORANT = "Doctorant"; const ROLE_ID_BUREAU_DES_DOCTORATS = "Maison du doctorat"; Loading
module/Application/src/Application/Provider/IdentityProvider.php +8 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ use Application\Service\UniteRecherche\UniteRechercheServiceAwareTrait; use Application\Service\Utilisateur\UtilisateurServiceAwareTrait; use Application\SourceCodeStringHelperAwareTrait; use BjyAuthorize\Provider\Identity\ProviderInterface; use UnicaenAuth\Acl\NamedRole; use UnicaenAuth\Provider\Identity\ChainableProvider; use UnicaenAuth\Provider\Identity\ChainEvent; use Zend\Authentication\AuthenticationService; Loading Loading @@ -91,10 +92,14 @@ class IdentityProvider implements ProviderInterface, ChainableProvider return []; } $this->roles = array_merge([], $this->getRolesFromActeur(), $roleAuthentifie = $this->roleService->getRepository()->findByCode('user')/*->setLibelle("coucou")*/; $this->roles = array_merge( [$roleAuthentifie], // $this->getRolesFromActeur(), $this->getRolesFromIndividuRole(), $this->getRolesFromDoctorant()); // $this->getRolesFromDoctorant() ); // Lignes mises en commentaire car revient à considérer le rôle "BdD UCN" identique au rôle "BdD URN" ! // La question est: pourquoi avoir fait ça ? Loading