All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pl.touk.nussknacker.ui.api.NussknackerRoutes.scala Maven / Gradle / Ivy

There is a newer version: 1.17.0
Show newest version
package pl.touk.nussknacker.ui.api

import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.Route
import pl.touk.nussknacker.ui.security.api.LoggedUser

trait RouteWithUser {

  final def securedRouteWithErrorHandling(implicit user: LoggedUser): Route = {
    handleExceptions(NuDesignerErrorToHttp.nuDesignerErrorHandler) {
      securedRoute
    }
  }

  protected def securedRoute(implicit user: LoggedUser): Route
}

trait RouteWithoutUser {

  final def publicRouteWithErrorHandling(): Route = {
    handleExceptions(NuDesignerErrorToHttp.nuDesignerErrorHandler) {
      publicRoute()
    }
  }

  protected def publicRoute(): Route
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy