Skip to content
Snippets Groups Projects
Commit 8d3d4cf3 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Merge branch 'release-1.2.2'

parents 583527a2 fbd40de8
Branches
Tags 4.0.0
No related merge requests found
Pipeline #5052 failed
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
......
......@@ -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',
];
--
-- 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
);
# 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
<?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,
]
],
],
......
......@@ -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';
}
......@@ -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>
......
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment