Acl factory the MVC way

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

Acl factory the MVC way

Jurian Sluiman-4
Hi all, [1]


I'm trying to get the Auth+Acl combination working with very dynamic pages where pages are in categories (they can be inherited and act like a domain or something) and users are in groups (inherited as well).


Because of the complexity I'd like to use the factory method of the CodeUtopia post [2]. I'd like to do this completely MVC and the ZF1.8 / ZF1.9 way. This is my set up:


- A front controller plugin, checking each page view for the right Acl permission
- Some models in the default module (Model_Acl_User, Model_Acl_Group etc)
- An Acl stored in the registry for more control later in the process (e.g. permission to edit etc)
- A factory to create the Acl with only the roles and resources necessary


Now the problem: where should I place the factory??? It's not a model, it's not a front controller plugin, an application resource doesn't seem right to me either. A factory class in my own library is an option, but is it the best option? What about an AclController in the default module?


I'd like to hear you opinion about this problem.
Thanks in advance,
Jurian Sluiman


[1]I hope you don't mind, but it's Acl in MVC so I sent it to both lists trying to get the best of both worlds
[2]http://codeutopia.net/blog/2009/02/18/zend_acl-part-3-creating-and-storing-dynamic-acls/
--
Jurian Sluiman
Soflomo.com

Reply | Threaded
Open this post in threaded view
|

Re: [fw-mvc] RE: Acl factory the MVC way

Jurian Sluiman-4
Op Monday 24 August 2009 08:24:22 schreef Саша Стаменковић:
> Thats ok, but what to do when you need to hide some links on the page? Use
> view helper?
>
> Regards,
> Saša Stamenković
>


I have stored the ACL now somewhere (registry) so at other points you can ask the acl also for permissions too.


Regards, Jurian
--
Jurian Sluiman
Soflomo.com


signature.asc (204 bytes) Download Attachment