On Wed, Dec 29, 2010 at 12:23 AM, Dave Maharaj <m...@davemaharaj.com> wrote:
>
> Because in the first example the $id will read from the db no matter what as
> long as $id is passed and $id is in the db so your going to the db no matter
> what and reading the data.
> In my way with $data = $this->Model->someFunction( $id,
> $this->Auth->User('id)); your only reading / finding / retrieving data if
> the conditions exist.
>
> In my head I think why pull the data if its not the owner with read? So pull
> the data using a find and if anything is found then continue on with the
> request.

So how does this someFunction method magically tell you that the User
in question is the correct one? You have to pull the data from the DB
in any case. I don't think it's a big deal to pull it based on
Record.id and then check user_id. But, if you'd rather have both
conditions in the find() then there's no harm in that either.

Which is the *correct* way? I dunno.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

Reply via email to