package sihl-user

  1. Overview
  2. Docs

Source file authz.ml

1
2
3
4
5
6
7
8
9
10
type guard = bool * string

let authorize (can, msg) = if can then Ok () else Error msg

let any guards msg =
  let can =
    guards |> List.map authorize |> List.find_opt Result.is_ok |> Option.is_some
  in
  authorize (can, msg)
;;
OCaml

Innovation. Community. Security.