authz.ml
sihl
sihl.authn
sihl.authz
sihl.core
sihl.database
sihl.email
sihl.http
sihl.message
sihl.middleware
sihl.migration
sihl.password-reset
sihl.queue
sihl.repository
sihl.schedule
sihl.session
sihl.storage
sihl.token
sihl.user
sihl.utils
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) ;;
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) ;;