diff --git a/Controller/AbstractBaseController.php b/Controller/AbstractBaseController.php index 7875394..abb0999 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($role, $object); } /** @@ -151,4 +155,4 @@ protected function flashNotDeleted() { $this->flashError($this->trans('flash.delete_failed', array(), 'LazyantsToolkit')); } -} \ No newline at end of file +}