/** * Grant access to public areas to both users and guests */ public function grandAccessForPublicResourceToAllUsers() { $grant = function (Role $role) { $allow = function ($actions, $resource) use($role) { $this->adaptor->allow($role->getName(), $resource, $actions); }; array_walk($this->public_resources, $allow); }; array_map($grant, $this->roles); }
/** * Registered resources with the Access. * * @param \Phalcon\Acl\AdapterInterface $access * @return $this */ public function registerAccess(AclAdapterInterface $access) { $this->_access = $access; $access->addResource(new AclResource(get_class($this->_resource)), $this->_methodName); return $this; }