Re: [fw-general] Zend_Acl & MVC Integration is ready for review

2008-10-16 Thread aSecondWill



Aldemar Bernal-3 wrote:
> 
> I just finished the work in this component, comments about it are welcome.
> http://framework.zend.com/wiki/pages/viewpage.action?pageId=39025
> 

Hi Aldemar, thanks for this. Ive implemented this in my application, but am
having problems with it using modules. 

do i need to specify every single controller in the resource list and allow
list? or can i just say guest is allowed to default module and admin allowed
to default and admin modules?  

/** Creating the ACL object */ 
//require_once 'Zend/Acl.php'; 
$acl = new Zend_Acl(); 
/** Creating Roles */ 
$acl->addRole(new Zend_Acl_Role('guest'));
$acl->addRole(new Zend_Acl_Role('cmsadmin'),'guest');
// Define our controllers as resources.
$acl->add(new Zend_Acl_Resource('admin'));  
$acl->add(new Zend_Acl_Resource('admin:login'));
$acl->add(new Zend_Acl_Resource('default'));
// Define our group access rules. Syntax is $acl->allow('User Group',
'module:Controller(?))', 'Action');
$acl->allow('guest','admin:login') ;
$acl->allow('guest','default');  // alow access to the default module
$acl->allow('cmsadmin','admin') ; // allow access to the admin module?

/** Registering the Plugin object */ 
$aclPlugin = new App_Plugin_Acl($acl); 
$aclPlugin->setDeniedAction('index','error','default'); 
$frontController->registerPlugin($aclPlugin); 


Thanks for any help. 

Will

-- 
View this message in context: 
http://www.nabble.com/Zend_Acl---MVC-Integration-is-ready-for-review-tp14997448p20027075.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Acl & MVC Integration is ready for review

2008-01-21 Thread Aldemar Bernal
Hi,

I just finished the work in this component, comments about it are welcome.

http://framework.zend.com/wiki/pages/viewpage.action?pageId=39025


Aldemar