Hi all,

I am a newbie to cakephp & php OO..

I am confused how best to handle the following case:
- Shop hasAndBelongsToMany Users (who can edit the Shop details).
- Now, in the shops view page (say shops/view/2), how to check that
the currently logged in user can edit the shop (2) details?

I was thinking of adding the following to the shop.php model:

   var $hasAndBelongsToMany = array('User' =>
                              array('className'  => 'User',
                                    'joinTable'  => 'users_shops',
                                    'conditions' => 'User.id = '.
$this->Session->read('User.id'),
                              )
                              );

If this works, I could just read the $shop['User'] to check if the
current user can edit the Shop details. But it doesnt seem to work.

Any better way to get this working?
TIA
john


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to