Tuesday, December 28, 2010

RE: Owner Check

So is that the best way to check owner against user? Well im sure there is
no best way since every situation is different but doing it this way is just
as good?
Simply try to get the request as normal and then process it. If $data then
there is a record do whatever with the data, if no $data then the user is
attempting to get something not theirs so $data will be empty tell user they
are an idiot :)

Just curious since some of the function

$data = $this->User->somefunctionToReturnUserRecord();

If($data){


}
If (!$data){

}

-----Original Message-----
From: cricket [mailto:zijn.digital@gmail.com]
Sent: Tuesday, December 28, 2010 3:51 PM
To: cake-php@googlegroups.com
Subject: Re: Owner Check

On Mon, Dec 27, 2010 at 9:51 PM, Dave Maharaj <me@davemaharaj.com> wrote:
> For the example edit is a Auth only access function and User hasMany
XModel
> so there would need to be an $id to pull the correct record so passing the
> $id is needed. Unless I am not following what your saying?

Right, I read that wrong. Then I guess it comes down to whatever code
is in your __getUserRecord method to check that the $record has the
correct user_id.

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+unsubscribe@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: