https://kotlinlang.org logo
#arrow
Title
# arrow
v

veiset

01/03/2019, 12:20 PM
Copy code
fun organisationNumber(): Either<Failure, OrganisationNumber> =
        Try {
            ctx.clientSubmittedData()?.get(SessionContextKeys.USER_SELECTED_ORG_NO)?.toOrganisationNumber()
        }.toEither {
            Failure.Server("Failed to fetch user selected organisation number from SecurityContext", it)
        }.leftIfNull {
            Failure.Access("Received client submitted user selected organisation was null")
        }