code: public function getPermissionMap( $forRequestPath, $forRoutePath = "" ){
          
          if(isset($this->loaded[$forRequestPath])){
              return $this->loaded[$forRequestPath];
          }
  
          $database         = $this->database;
  
          //Get Permission Definitions
          $permissionsSQLd = NULL;
          if(!empty($forRoutePath) && ($forRoutePath <> $forRequestPath) ):
              $permissionsSQLd = "OR {$database->quote($forRoutePath)} REGEXP p.permission_area_uri";
          endif;
  
          //Get Permission Definitions
          $premissionsSQLc  = "SELECT p.*, a.lft, a.rgt, a.authority_name,a.authority_parent_id FROM ?authority_permissions AS p LEFT JOIN ?authority AS a ON p.authority_id=a.authority_id WHERE {$database->quote($forRequestPath)} REGEXP p.permission_area_uri {$permissionsSQLd} ORDER BY a.lft ASC";
          $permissionsSQL   = $database->prepare( $premissionsSQLc );
          $permissions      = $permissionsSQL->execute()->fetchAll();
          
          $this->loaded[$forRoutePath] = $permissions;
          
          return $this->loaded[$forRoutePath];
    
      }
docs: Cacheing the permission tree query
  
  @param type $actionRoute
  @param type $actionRealRoute
  @return type