Tuesday, July 3, 2012

Re: Login problem

Well, still shows the same problem. In the other Controller i override this method like this:

  public function isAuthorized($usuario = null) {
   if (($usuario['Status'] == 'Super') || ($usuario['Status'] == 'Coordenador')) {
       return true;
   }
   if (in_array($this->action, array('edit', 'delete'))) {
       if ($usuario['Id'] != $this->request->params['pass'][0]) {
           return false;
       }
   }
   return true;
}*/
public function isAuthorized($usuario = null) {
        // Any registered user can access public functions
        if (empty($this->request->params['Coordenador'])) {
            return true;
        }

        // Only admins can access admin functions
        if (isset($this->request->params['Super'])) {
            return (bool)($usuario['Status'] === 'Super');
        }

        // Default deny
        return false;

Yes, I know, I tried both of them. Nothing changes...


2012/7/3 Cosmin Paul <cosmin.paul@gmail.com>
Make sure you call parent class, If you over-right the `isAuthorized` method.

return parent::isAuthorized($user);

Maybe this helps you,
Cheers
Paul

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

No comments: