Ver Mensaje Individual
  #8 (permalink)  
Antiguo 26/02/2010, 09:59
Ferdinandum
 
Fecha de Ingreso: noviembre-2008
Mensajes: 62
Antigüedad: 15 años, 5 meses
Puntos: 1
Respuesta: Ejemplo ACL con Clases

Ok pero en este if intenta buscar que ACL tienes empezando por Action.

[QUOTE=Nemutagk;3284950]
//Tomamos el nombre del recurso actual (action,controller,module)
if ($this->_acl->has($this->getRequest()->getActionName())) {
$resource = $this->getRequest()->getActionName();
}else if ($this->_acl->has($this->getRequest()->getControllerName())) {
$resource = $this->getRequest()->getControllerName();
}else if ($this->_acl->has($this->getRequest()->getModuleName())) {
$resource = $this->getRequest()->getModuleName();
}
[/HIGHLIGHT]

Por ejemplo tengo El Modulo Cuentas, con el controler Index y la acciones Index, Mostrar y tambien tengo el controller Estadísticas con un par de acciones

Seria correcto esto:
Código PHP:
//Recurso
$this->add(new Zend_Acl_Resource('Cuentas')); 
//Controller Index
$this->allow('user1','Index',array('Index');
//Controller Estadistica
$this->deny('user1','Estadisticas', array('Accion1','Accion2'))
$this->allow('user1','Estadisticas', array('Accion3'