Chris Morrell-2 wrote:
> 
> Right now I treat my models as resources with a special exception for the
> user model which is both a resource and a role.  Then I actually make the
> models responsible for managing their own ACL permissions, both setting
> them
> up and querying them.  To facilitate that, I have a base model class that
> does a few things.  First it has a way to inject an ACL instance into the
> model as well as a way to pass an ACL instance as the default ACL for all
> models (which I do in my bootstrap).  Second it automatically adds itself
> to
> that ACL (with the resource id model:moduleName.modelName).  Finally, I
> have
> an *_initAcl()* method which is called when my model is instantiated which
> adds the appropriate rules to the ACL if they don't already exist. 
> Whenever
> my model is doing something that is access-controlled I check the ACL
> right
> then.
Hi Chris, thanks for that.  Added you to my list of blogs to follow.  I'll
try to give some feedback here in the next few days.  Just as a background,
I'm forging ahead with Doctrine 2 along with the idea that the actual model
classes shouldn't be extending any base classes (related to data access),
but I think I agree that they can/should be able to extend/interact with ACL
related classes (where appropriate).

Right now, I have most all of my model interaction occurring thought a
service layer that requires the Doctrine EntityManager (DI), so that when I
operate on my "models" I'm just passing the (more or less) plain old PHP
objects around.  I'm still very early in the development/prototyping stage,
so there are still lots of design decisions left to be made.
-- 
View this message in context: 
http://n4.nabble.com/Models-and-Services-ACL-Where-and-How-tp1692595p1693469.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to