From 8838be62ed831b016cc51a853a563f8edd29ecf6 Mon Sep 17 00:00:00 2001 From: Bertrand Gauthier <bertrand.gauthier@unicaen.fr> Date: Wed, 28 Aug 2019 11:05:21 +0200 Subject: [PATCH] =?UTF-8?q?Suppression=20des=20usages=20r=C3=A9siduels=20d?= =?UTF-8?q?u=20privil=C3=A8ge=20=20qui=20n'existe=20plus.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/Information/config/module.config.php | 11 ++++++++++- .../Provider/Privilege/InformationPrivileges.php | 1 - .../Information/view/information/fichier/index.phtml | 4 ++-- .../view/information/information/index.phtml | 3 ++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/module/Information/config/module.config.php b/module/Information/config/module.config.php index 10d5136e1..fffe7988a 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 eaf551df4..658e02026 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 2e5077b25..215a8f673 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 e1755c3cb..8b050202d 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> -- GitLab