I guess you can do something like this:
$group_id=$this->Auth->user('group_id');
$products=$this->Product->find('all',array('conditions'=>array('Product.group_id'=>$group_id)));
Is this what you're looking for ?
Teddy
On Wed, Sep 21, 2011 at 12:28 PM, elogic <[email protected]>wrote:
> Is there any quick / better way to use Auth to limit the results based
> on the users login details or is it just a matter of using if/else
> statments to get what you want.
>
> For example, I have a list of products which all have a group id
> assigned to them. Each user also has a group id. When the user is
> logged in they are to only show the products that matches their group
> id.
>
> I'm only new to cakephp and still do not know all the tricks or short
> cuts for things like this.
>
> Thankyou
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group
> at http://groups.google.com/group/cake-php
>
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php