Last active
December 18, 2018 19:47
-
-
Save jhewlett/eeb2d2c23dd1681af92aa3d979971ae8 to your computer and use it in GitHub Desktop.
Independent authorization checks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let firstCheckResult () : Result<unit, NotAuthorized> = | |
match firstCheck () with | |
| Some c when c.CanRead -> Ok () | |
| _ -> Error NotAuthorized | |
let secondCheckResult () : Result<unit, NotAuthorized> = | |
match secondCheck () with | |
| Some c when c.CanRead -> Ok () | |
| _ -> Error NotAuthorized | |
let thirdCheckResult () : Result<unit, NotAuthorized> = | |
match thirdCheck () with | |
| Some c when c.CanRead -> Ok () | |
| _ -> Error NotAuthorized |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment