On Sep 26, 2006, at 6:30 PM, BlenderStyle wrote:
> > After reading the CakePHP manual and tons of other things, I > understand > how ACLs work very well now. I even understand how modified pre-order > tree transversal works to some degree. I get how the various > methods in > the ACL components work. However, I still can't grasp how to actually > implement this. > > Let's break it down nice and simple. I have two models: User and Item. > I have four users: tom, dave, kerry, and jeff. I have four items: > guitar, bass, drums, mic. My access scenario: > > tom: mic, bass > dave: drums > kerry: guitar > jeff: guitar > > All of that is pretty simple, but how do I go about putting this into > functional code? If I have an add method in UsersController, I'm > assuming that's when I create an ARO right? Right. > And when I use the add > method in ItemsController, I create an ACO right? Yeah, if you want an ACO for every item. Is there any sort of grouping? > If I have that right, > where do I set the access? It's done by granting an ARO (ortree of AROs) access to an ACO (or tree of ACOs) > Do I create a whole other controller just > for dealing with ACL or do I do everything in my UsersControllers? You're probably fine just injecting the ACL stuff inside the rest of your application. If you ever want to play with AROs or ACOs directly, though, you might want a controller for it. > Like I said, it all makes sense on what all these methods do, but > where > do I use them? Which methods? > There are tutorials out there on the CakePHP wiki and > posts in this group, but honestly, they just confuse me. Simply > put, in > what models/controllers do I use these various ACL methods? ARO and ACO creation (and access checks) will happen a lot in the controller. ACL stuff in models would be rather rare, but I can see certain ACL things happening in the views as well (the controller would probably hand down most of those decisions, though). -- John --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~----------~----~----~----~------~----~------~--~---
