title: How to validate if the User is admin or customer in match function on a custom route
body: <p>I needed to know who is accessing a particular route is logged and if it is a customer or admin User, any idea how to do that on match function controllador route? </p>
  
  <p>Code of the custom route controller:</p>
  
  <pre><code>class Ceicom_Boleto_Controller_Router extends Mage_Core_Controller_Varien_Router_Abstract
  {
      public function initControllerRouters($observer)
      {
          $front = $observer-&gt;getEvent()-&gt;getFront();
          $boleto = new Ceicom_Boleto_Controller_Router();
          $front-&gt;addRouter('boleto',$boleto);
      }
      public function match(Zend_Controller_Request_Http $request)
      {
         /*
           if is admin and is logged
         */
         Mage::app()-&gt;getFrontController()-&gt;getResponse()
                    -&gt;setRedirect("/boleto/admin/view/")
                    -&gt;sendResponse();
         exit;
        /*
           if is user and is logged
        */
         Mage::app()-&gt;getFrontController()-&gt;getResponse()
                    -&gt;setRedirect("/boleto/user/view/")
                    -&gt;sendResponse();
         exit;
  
      }
  }
  </code></pre>