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>