array( 'login', 'logout', 'register', 'forgotpassword', 'getpassword', 'captcha', 'index' ), //service 'Application\Controller\Service' => array( 'upload', 'delatt', 'thumb', 'bigthumb' ), 'Article\Controller\Article' => array( 'index', 'view' ), 'Article\Controller\Category' => array( 'index', 'list' ), 'Metadata\Controller\Index', ); function __construct(Acl &$acl) { $this->acl = $acl; $this->loadResource(); $acl = $this->acl; } public function loadResource() { foreach($this->config as $index => $resource) { if(!is_array($resource)) { $this->acl->addResource(new Resource($resource)); continue; } $this->acl->addResource(new Resource($index)); foreach($resource as $action) { if($this->acl->hasResource($action)) { continue; } $this->acl->addResource(new Resource($action),$index); } } } }