You can also use the isAuthorized ("controller" or "model") option in
AuthComponent. It is a great way of doing basic authorization like
this. See
http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/
Geoff
--
http://lemoncake.wordpress.com
On Sep 13, 3:31 pm, Grant Cox <[EMAIL PROTECTED]> wrote:
> Yes, you will need conditionals to check the authentication level, but
> most of this should be done automatically by whatever ACL mechanism
> you use.
>
> Personally I just have a function isUserOwned( $modeltype, $model_id )
> in my app_controller, which does a lookup to see if the current user's
> id matches that particular model's row. If there is no match then the
> request is redirected.
>
> On Sep 13, 2:06 pm, seans9 <[EMAIL PROTECTED]> wrote:
>
> > I'm new to cakephp. What is the best way to control content based on a
> > user id? I've read all about authenticating which i'm sure I won't
> > have a problem setting up. Will I need to use conditionals before all
> > of my functions to make sure a user is only viewing/adding/editing
> > content with his session user id or is there an easier way?
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---