From d5ef5978a8b98e20862a94b734f7d5b93d5e68ea Mon Sep 17 00:00:00 2001 From: "Philipp A. Mohrenweiser" Date: Fri, 4 Aug 2017 14:14:10 +0200 Subject: [PATCH 1/2] Adapt for recent symfony versions Having bc layer for older ones --- Controller/AbstractBaseController.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Controller/AbstractBaseController.php b/Controller/AbstractBaseController.php index 7875394..1c6ca2a 100644 --- a/Controller/AbstractBaseController.php +++ b/Controller/AbstractBaseController.php @@ -77,9 +77,13 @@ protected function trans($id, array $parameters = array(), $domain = 'messages', * @param string $role * @return bool */ - protected function isGranted($role) + protected function isGranted($role, $object = null) { - return $this->get('security.context')->isGranted($role); + if (!$this->container->has('security.authorization_checker')) { + return $this->get('security.context')->isGranted($role); + } + + return $this->get('security.authorization_checker')->isGranted($attributes, $object); } /** @@ -151,4 +155,4 @@ protected function flashNotDeleted() { $this->flashError($this->trans('flash.delete_failed', array(), 'LazyantsToolkit')); } -} \ No newline at end of file +} From a19e6fe25870664f7b6647b94349f3d4765ad63f Mon Sep 17 00:00:00 2001 From: phiamo Date: Fri, 4 Aug 2017 15:10:27 +0200 Subject: [PATCH 2/2] fix varname --- Controller/AbstractBaseController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controller/AbstractBaseController.php b/Controller/AbstractBaseController.php index 1c6ca2a..abb0999 100644 --- a/Controller/AbstractBaseController.php +++ b/Controller/AbstractBaseController.php @@ -83,7 +83,7 @@ protected function isGranted($role, $object = null) return $this->get('security.context')->isGranted($role); } - return $this->get('security.authorization_checker')->isGranted($attributes, $object); + return $this->get('security.authorization_checker')->isGranted($role, $object); } /**