This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit

eZ Community » Forums » eZ Publish 5 Platform » How to declare access restriction to...

How to declare access restriction to a view

How to declare access restriction to a view

Wednesday 10 April 2013 1:14:31 pm - 2 replies

If I understand, I have to code the following lines in my controller action method :


if ( !$this->isGranted( new AuthorizationAttribute( $module , $function ) ) )       

    throw new AccessDeniedException();


I know how to declare the $module/$function in the old way, but how to do in the new way ?

Friday 12 April 2013 10:53:29 am

Hi Bruno

This have not changed. $module and $function are still the same than before, but as admin is rendered via the legacy stack, you still need to declare those in your module.php (in legacy extension). Then you'll be able to use it with eZ\Publish\Core\MVC\Symfony\Security\Authorization\Attribute

Saturday 13 April 2013 12:35:39 am

Thank you Jerôme.

Modified on Saturday 13 April 2013 12:36:01 am by Nguyen Huu Bruno


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from