Skip to content

Commit

Permalink
Merge 2119f57 into a56e1a7
Browse files Browse the repository at this point in the history
  • Loading branch information
Qi77Qi committed Oct 11, 2018
2 parents a56e1a7 + 2119f57 commit 070b0dd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package org.broadinstitute.dsde.workbench.sam.api
package org.broadinstitute.dsde.workbench.sam
package api

import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
import akka.http.scaladsl.model.StatusCodes
Expand All @@ -7,13 +8,11 @@ import akka.http.scaladsl.server.Directive1
import akka.http.scaladsl.server.Directives._
import org.broadinstitute.dsde.workbench.model.WorkbenchIdentityJsonSupport._
import org.broadinstitute.dsde.workbench.model.{ErrorReport, WorkbenchEmail, WorkbenchExceptionWithErrorReport}
import org.broadinstitute.dsde.workbench.sam._
import org.broadinstitute.dsde.workbench.sam.model.SamJsonSupport._
import org.broadinstitute.dsde.workbench.sam.model._
import org.broadinstitute.dsde.workbench.sam.service.ResourceService
import spray.json.DefaultJsonProtocol._
import spray.json.JsBoolean

import scala.concurrent.ExecutionContext

/**
Expand Down Expand Up @@ -48,7 +47,7 @@ trait ResourceRoutes extends UserInfoDirectives with SecurityDirectives with Sam
withResourceType(ResourceTypeName(resourceTypeName)) { resourceType =>
pathEndOrSingleSlash {
get {
complete(policyEvaluatorService.listUserAccessPolicies(resourceType.name, userInfo.userId).unsafeToFuture())
complete(policyEvaluatorService.listUserAccessPolicies(resourceType.name, userInfo.userId))
} ~
post {
entity(as[CreateResourceRequest]) { createResourceRequest =>
Expand Down
11 changes: 11 additions & 0 deletions src/main/scala/org/broadinstitute/dsde/workbench/sam/api/api.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.broadinstitute.dsde.workbench.sam

import akka.http.scaladsl.marshalling.Marshaller
import cats.effect.IO

import scala.concurrent.Future

package object api {
implicit def ioMarshaller[A, B](implicit m: Marshaller[Future[A], B]): Marshaller[IO[A], B] =
Marshaller(implicit ec => (x => m(x.unsafeToFuture())))
}

0 comments on commit 070b0dd

Please sign in to comment.