mbauer83.zio_http_authorization.AuthorizationPolicy$.AllowAllPolicy
See theAllowAllPolicy companion object
class AllowAllPolicy[U <: User[_, _], R <: Resource[_]] extends AuthorizationPolicy[U, R]
An AuthorizationPolicy that always authorizes access to a resource.
Attributes
- Example
-
Create via companion object as in the following example
package mbauer83.zio_http_authorization import zio.{ZIO, Console, ZIOAppDefault} object AllPassAuthExample extends ZIOAppDefault: type ResourceType <: Resource[_] type UserType <: User def getUser: ZIO[Any, Nothing, UserType] = ??? def getResource: ZIO[Any, Nothing, ResourceType] = ??? override val run = for { user <- getUser resource <- getResource policy = AllowAllPolicy[UserType, ResourceType] authorizedResource <- policy.authorized(user)(resource) _ <- Console.printLine(authorizedResource) } yield ()
- Companion
- object
- Graph
-
- Supertypes
Members list
In this article