From 0680322faecdd55e2d070ec581b86570460c7c75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Baptiste=20Vad=C3=A9?= Date: Tue, 6 Nov 2018 15:53:16 +0100 Subject: [PATCH] Use hasPermission() in mayUpdateLibrary() It avoid mistakes in permissions names (ROLE_H5P_UPDATE_LIBRARIES != ROLE_UPDATE_H5P_LIBRARIES) I also correct the PHPDoc param of hasPermission --- Core/H5PSymfony.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/H5PSymfony.php b/Core/H5PSymfony.php index 89334e6..d058fda 100644 --- a/Core/H5PSymfony.php +++ b/Core/H5PSymfony.php @@ -301,7 +301,7 @@ public function isInDevMode() */ public function mayUpdateLibraries() { - return $this->authorizationChecker->isGranted('ROLE_UPDATE_H5P_LIBRARIES'); + return $this->hasPermission(\H5PPermission::UPDATE_LIBRARIES); } /** @@ -866,7 +866,7 @@ public function afterExportCreated($content, $filename) /** * Implements hasPermission * - * @param H5PPermission $permission + * @param int $permission * @param int $content_id * @return bool */