What is the best way to set up module based ACL in zend Framework?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

What is the best way to set up module based ACL in zend Framework?

codef0rmer
This post has NOT been accepted by the mailing list yet.
I have 2 types of users, guest and user. I have created 2 modules, admin and foobar, and in addition to it, there is a front end with default module. I want user to logged in before accessing any controller from admin/foobar modules but can access front end without login. The thing is that i am not getting any suitable article to learn on how to set up module based acl in zend framework.
Reply | Threaded
Open this post in threaded view
|

Re: What is the best way to set up module based ACL in zend Framework?

Peter Sharp
Probably the most direct way would be to instead of checking the name of the controller against resources in the ACL, check the module_controller name.  So the default module index controller would be default_index, admin module index controller would be admin_index, etc.

You'll need to change your ACL definition to match the new names, and you'll need at least 1 entry for each controller of each module, but you get to stay with your current implementation of the ACL and you keep control on each module / controller / action.