Have a look at admin routing. You don't need to have separate controllers for what you want to do.
On Mon, Jul 27, 2009 at 12:30 PM, Michael Gaiser<mjgai...@gmail.com> wrote: > Well, my users and locations use the same setup. I have split up my normal > controller into 2 parts so I can have different permissions and functions. > ie, I don't want normal users to be able to delete user records, only > admins. So instead of having all my functions have an admin test, which > would seem to be ignoring the ACL stuff. > > With the 2 controllers, I can set the user controller to just have the > standard user functions, but then have the UsersAdmin controller require > that the user is an admin to access it. It also allows for separate > functions so that the user can edit their account settings, but with limited > access. Only the Admin can edit the username and stuff like that. If there > is a better way to be using the Auth component, I would love to hear it, but > having the controller split into normal/admin seems to be the only way I > found to make it work. And since there is a ton of shared code between them, > I wanted to have the admin inherit from the normal, then add in the > additional functionality. > > So that's where I am right now. I hope that sheds some light on what I am > trying to accomplish. > > ~Michael > > On Mon, Jul 27, 2009 at 4:46 PM, brian <bally.z...@gmail.com> wrote: >> >> On Mon, Jul 27, 2009 at 10:32 AM, Michael Gaiser<mjgai...@gmail.com> >> wrote: >> > When I try that, I end up with this error >> > >> > Fatal error: Class 'LocationController' not found in >> > C:\wamp\www\theinconnu\app\controllers\locationmanager_controller.php on >> > line 6 >> >> You might have to include the path: >> >> http://api.cakephp.org/class/app#method-Appimport >> >> > So for the parent controller name, do I use 'Location' or >> > 'LocationController'? >> >> "Location" would be the name of the model. If your class file says >> "class LocationController ..." at the top, that's the name to use. >> Although it really should be LocationsController. >> >> But I wonder if you'd be better off without importing one controlller >> into another. You began by mentioning something called UserAdmin, >> which suggests that you could just stick with Users and admin routing. >> Where does this LocationController fit in? >> >> > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---