diff --git a/CHANGELOG.md b/CHANGELOG.md index 08bb7341a3bf885f3db0887f8660658be48002e0..f659fb541928b30501035cb3e9ca32510b544d7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,15 @@ Journal des modifications ========================= -1.2.1 () +1.2.2 (28/08/2019) +------------------ + +### Corrections + +- Suppression des usages résiduels du privilège `InformationPrivileges::INFORMATION_FICHIER` qui n'existe plus. + + +1.2.1 (11/07/2019) ------------------ ### Ajout diff --git a/config/autoload/version.global.php b/config/autoload/version.global.php index 0663c70d7a3524cf64751b316c9061f0490fbb0a..fbed46bc923d44f247f801e3ea98a8e9ca94fca7 100644 --- a/config/autoload/version.global.php +++ b/config/autoload/version.global.php @@ -2,9 +2,9 @@ return [ 'unicaen-app' => [ 'app_infos' => [ - 'version' => '1.2.1', - 'date' => '11/07/2019', + 'version' => '1.2.2', + 'date' => '28/08/2019', ], ], - 'comment' => 'Fichier généré le 11/07/2019 à 16:32:53 avec /home/gauthierb/workspace/sygal/bump-version', + 'comment' => 'Fichier généré le 28/08/2019 à 10:51:03 avec /home/gauthierb/workspace/sygal/bump-version', ]; diff --git a/data/SQL/1.2.2/10_fichier_divers.sql b/data/SQL/1.2.2/10_fichier_divers.sql new file mode 100644 index 0000000000000000000000000000000000000000..40cb15618272939fb5914669a402d0e72710379b --- /dev/null +++ b/data/SQL/1.2.2/10_fichier_divers.sql @@ -0,0 +1,27 @@ +-- +-- Insertions oubliées dans le script SQL de la version 1.2.1. +-- + +-- Ajout des privilèges fichier-divers/* au profil 'ADMIN_TECH' +insert into PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID) + with data(categ, priv) as ( + select 'fichier-divers', 'televerser' from dual union + select 'fichier-divers', 'telecharger' from dual + ) + select p.id as PRIVILEGE_ID, profil.id as PROFIL_ID + from data + join PROFIL on profil.ROLE_ID in ('ADMIN_TECH') + join CATEGORIE_PRIVILEGE cp on cp.CODE = data.categ + join PRIVILEGE p on p.CATEGORIE_ID = cp.id and p.code = data.priv +/ +-- Attribution (si pas déjà fait) des privilèges fichier-divers/* au rôle 'ADMIN_TECH' (grâce au profil). +insert into ROLE_PRIVILEGE (ROLE_ID, PRIVILEGE_ID) + SELECT r.id as ROLE_ID, p.ID as PRIVILEGE_ID + from PROFIL_PRIVILEGE pp + join profil on PROFIL.ID = pp.PROFIL_ID and profil.ROLE_ID in ('ADMIN_TECH') + join PRIVILEGE p on p.id = pp.PRIVILEGE_ID + join CATEGORIE_PRIVILEGE cp on cp.id = p.CATEGORIE_ID and cp.CODE = 'fichier-divers' + join role r on r.CODE = PROFIL.ROLE_ID + where not exists ( + select * from ROLE_PRIVILEGE rp where rp.ROLE_ID = r.id and rp.PRIVILEGE_ID = p.id + ); diff --git a/doc/release-notes/v1.2.2.md b/doc/release-notes/v1.2.2.md new file mode 100644 index 0000000000000000000000000000000000000000..082e7f7eee8e78b9b88ec40aaff02b545628fa93 --- /dev/null +++ b/doc/release-notes/v1.2.2.md @@ -0,0 +1,20 @@ +# Version 1.2.2 + +## 1. Sur le serveur d'application + +- Placez-vous dans le répertoire de l'application puis lancez la commande suivante +pour installer la nouvelle version : + +```bash +git fetch --tags && git checkout --force 1.2.2 && \ +bash ./install.sh +``` + +- Selon le moteur PHP que vous avez installé, rechargez le service, exemple : + - php7.0-fpm : `service php7.0-fpm reload` + - apache2-mod-php7.0 : `service apache2 reload` + +## 2. Dans la base de données + +Exécuter les scripts SQL suivants dans l'ordre : + - `data/SQL/1.2.2/10_fichier_divers.sql` \ No newline at end of file diff --git a/module/Information/config/module.config.php b/module/Information/config/module.config.php index 10d5136e1f4603e1831164bd36cc6524bec7dc68..fffe7988a4f64535f7fd2fd6a2736e00ca55f982 100755 --- a/module/Information/config/module.config.php +++ b/module/Information/config/module.config.php @@ -1,6 +1,7 @@ <?php use Application\Entity\Db\Repository\DefaultEntityRepository; +use Application\Provider\Privilege\FichierPrivileges; use Information\Controller\FichierController; use Information\Controller\InformationController; use Information\Controller\InformationControllerFactory; @@ -112,10 +113,18 @@ return [ 'action' => [ 'index', 'supprimer', + ], + 'privileges' => [ + InformationPrivileges::INFORMATION_MODIFIER, + ] + ], + [ + 'controller' => FichierController::class, + 'action' => [ 'telecharger', ], 'privileges' => [ - InformationPrivileges::INFORMATION_FICHIER, + FichierPrivileges::FICHIER_DIVERS_TELECHARGER, ] ], ], diff --git a/module/Information/src/Information/Provider/Privilege/InformationPrivileges.php b/module/Information/src/Information/Provider/Privilege/InformationPrivileges.php index eaf551df479060ac027d795ecded4b66f5ff80ce..658e0202634e4d1b8f9f1986e4bc92c03d1b9503 100644 --- a/module/Information/src/Information/Provider/Privilege/InformationPrivileges.php +++ b/module/Information/src/Information/Provider/Privilege/InformationPrivileges.php @@ -15,5 +15,4 @@ class InformationPrivileges extends Privileges * Todo: créer une catégorie de privilèges 'page-information'. */ const INFORMATION_MODIFIER = 'faq-modifier-information'; - const INFORMATION_FICHIER = 'faq-modifier-fichier'; } diff --git a/module/Information/view/information/fichier/index.phtml b/module/Information/view/information/fichier/index.phtml index 2e5077b255b1f0a4e265cad37cd2a2fbd9ac8438..215a8f6737207d35bbf4f661f2fcaf6b9ef7c315 100644 --- a/module/Information/view/information/fichier/index.phtml +++ b/module/Information/view/information/fichier/index.phtml @@ -3,11 +3,11 @@ /** @var Fichier[] $fichiers */ use Application\Entity\Db\Fichier; -use Information\Provider\Privilege\InformationPrivileges; +use Application\Provider\Privilege\FichierPrivileges; $this->headTitle("Fichiers associés aux pages d'information"); -$canFichier = $this->isAllowed(InformationPrivileges::getResourceId(InformationPrivileges::INFORMATION_FICHIER)); +$canFichier = $this->isAllowed(FichierPrivileges::getResourceId(FichierPrivileges::FICHIER_DIVERS_TELEVERSER)); ?> <style> diff --git a/module/Information/view/information/information/index.phtml b/module/Information/view/information/information/index.phtml index e1755c3cbae7d569dfb8b65153d4946cf2efe8fc..8b050202d98c6125e129fbf8a91ec07c83c65a65 100644 --- a/module/Information/view/information/information/index.phtml +++ b/module/Information/view/information/information/index.phtml @@ -4,6 +4,7 @@ * @var Information[] $informations */ +use Application\Provider\Privilege\FichierPrivileges; use Information\Entity\Db\Information; use Information\Provider\Privilege\InformationPrivileges; @@ -12,7 +13,7 @@ $this->headTitle("Index des informations"); $canView = true; $canEdit = $this->isAllowed(InformationPrivileges::getResourceId(InformationPrivileges::INFORMATION_MODIFIER)); $canDelete = $this->isAllowed(InformationPrivileges::getResourceId(InformationPrivileges::INFORMATION_MODIFIER)); -$canFichier = $this->isAllowed(InformationPrivileges::getResourceId(InformationPrivileges::INFORMATION_FICHIER)); +$canFichier = $this->isAllowed(FichierPrivileges::getResourceId(FichierPrivileges::FICHIER_DIVERS_TELEVERSER)); ?> <style>