this is integrated into the AuthComponent already.
function beforeFilter() {
$this->Auth->authorize = array('model' => 'User');
}
then put this in the User model for instance.
function isAuthorized($user, $controller, $action) {
//do some checks
return false;
}
if you want to do it for the model of the current request, then just
use
$this->Auth->authorize = array('model' => $this->modelClass);
and put the isAuthorized method in your AppModel as you suggest.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---