/**
  * {@inheritdoc}
  */
 public function handle(Route $route, array $inputs)
 {
     $permissions = $route->getRequiredPermissions();
     if (!empty($permissions)) {
         if ($this->user->hasPermission($permissions)) {
             throw new AuthorizationException();
         }
     }
     // Pass the request to the next middleware
     return !is_null($this->next) ? $this->next->handle($route, $inputs) : null;
 }