nee-core / dev.neeffect.nee.effects.security / SecuredRunEffect

SecuredRunEffect

class SecuredRunEffect<USER, ROLE, R : SecurityProvider<USER, ROLE>> : Effect<R, SecurityError>

Constructors

<init>

SecuredRunEffect(singleRole: ROLE)
SecuredRunEffect(roles: List<ROLE>)

Functions

wrap

Wrap a business function in a given effect

fun <A> wrap(f: (R) -> A): (R) -> Pair<Out<SecurityError, A>, R>

Extension Functions

andThen

Composition of effects.

fun <R1, E1, R2 : R1, E2> Effect<R2, E2>.andThen(otherEffect: Effect<R1, E1>): Effect<R2, Either<E1, E2>>

anyError

fun <R, E> Effect<R, E>.anyError(): Effect<R, Any>

plus

operator fun <R1, E1, R2 : R1, E2 : E1> Effect<R2, E2>.plus(otherEffect: Effect<R1, E1>): Effect<R2, E1>

then

infix fun <R1, E1, R2 : R1, E2> Effect<R2, E2>.then(otherEffect: Effect<R1, E1>): Effect<R2, Either<E1, E2>>

with

infix fun <R1, E1, R2 : R1, E2 : E1> Effect<R2, E2>.with(otherEffect: Effect<R1, E1>): Effect<R2, E1>