title: CakePHP 2.4.4 isAuthorized() not working properly
body: <p>I am using the CakeDC users plugin and I am having trouble getting only admins to be able to view the admin section as it stands any registered user can access admin.  what am i doing wrong?</p>
  
  <p><strong>AppController.php</strong></p>
  
  <pre><code>class AppController extends Controller {
      public $components = array(
          'DebugKit.Toolbar',
          'Auth' =&gt; array('authorize' =&gt; array('Controller')
          )
      );
  
      public function isAuthorized($user = null) {
          // Any registered user can access public functions
          if (empty($this-&gt;request-&gt;params['admin'])) {
              return true;
          }
  
          // Only admins can access admin functions
          if (isset($this-&gt;request-&gt;params['admin'])) {
              return (bool)($user['role'] === 'admin');
          }
  
          // Default deny
          return false;
      }
  
      public function beforeFilter(){
          $this-&gt;Auth-&gt;allow("display");
          if ($this-&gt;Auth-&gt;loggedIn()) {
              $this-&gt;layout = 'loggedin';
          }
  
  
      }
  
  }
  </code></pre>
  
  <p><strong>UsersController.php</strong> (from the CakeDC users plugin controller)</p>
  
  <pre><code>//other code here
      public function isAuthorized($user = null) {
          return parent::isAuthorized($user);
      }
  //other code here
  </code></pre>
  
  <p><strong>routes.php</strong></p>
  
  <pre><code>Router::connect('/users', array('plugin' =&gt; 'users', 'controller' =&gt; 'users'));
  Router::connect('/users/index/*', array('plugin' =&gt; 'users', 'controller' =&gt; 'users'));
  Router::connect('/users/:action/*', array('plugin' =&gt; 'users', 'controller' =&gt; 'users'));
  Router::connect('/users/users/:action/*', array('plugin' =&gt; 'users', 'controller' =&gt; 'users'));
  Router::connect('/login', array('plugin' =&gt; 'users', 'controller' =&gt; 'users', 'action' =&gt; 'login'));
  Router::connect('/logout', array('plugin' =&gt; 'users', 'controller' =&gt; 'users', 'action' =&gt; 'logout'));
  Router::connect('/register', array('plugin' =&gt; 'users', 'controller' =&gt; 'users', 'action' =&gt; 'add'));
  Router::connect('/admin', array('plugin' =&gt; 'users', 'controller' =&gt; 'users', 'admin' =&gt; true));
  Router::connect('/admin/:action/*', array('plugin' =&gt; 'users', 'controller' =&gt; 'users', 'admin' =&gt; true));
  </code></pre>
  
  <p><strong>core.php</strong></p>
  
  <pre><code>Configure::write('Routing.prefixes', array('admin'));
  </code></pre>
  
  <p><strong>EDIT:</strong>
  isAuthorized() was not being called when i called the authorize = array('Controller') in the components. Had to add this in the beforeFilter() of the AppController: $this->Auth->authorize = 'Controller';</p>