polysemy-account-api-0.2.0.0: Account management with Servant and Polysemy
Safe HaskellSafe-Inferred
LanguageHaskell2010

Polysemy.Account.Api.Effect.Authorize

Description

 
Synopsis

Documentation

data Authorize i param priv :: Effect where Source #

This effect is used by the combinators in Polysemy.Account.Api.Server.AuthEndpoint to decide whether an account is authorized to access an endpoint.

The type parameters signify:

i
The storage ID type.
param
Identifies the authorization requirements of the endpoint.
priv
The privilege type stored in the database.

Constructors

Authorize :: param -> AuthedAccount i priv -> Authorize i param priv m (Maybe Text)

Decide whether the given account is authorized to use the endpoint characterized by the param. Return Just an error message if access is denied.

authorize :: forall i param priv r. Member (Authorize i param priv) r => param -> AuthedAccount i priv -> Sem r (Maybe Text) Source #

Decide whether the given account is authorized to use the endpoint characterized by the param. Return Just an error message if access is denied.

type AuthorizeP i = Authorize i [Privilege] [Privilege] Source #

Convenience alias for using the default privilege type with Authorize.