Skip to content

Instantly share code, notes, and snippets.

@jhewlett
Last active December 18, 2018 19:42
Show Gist options
  • Save jhewlett/556e71a759ab6c909f452f8b12067809 to your computer and use it in GitHub Desktop.
Save jhewlett/556e71a759ab6c909f452f8b12067809 to your computer and use it in GitHub Desktop.
Nested authorization checks
match firstCheck () with
| Some c when c.CanRead -> Ok ()
| _ ->
match secondCheck () with
| Some c when c.CanRead -> Ok ()
| _ ->
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