Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

Commit 3dede40a authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Simplification

parent 56a7581f
...@@ -299,15 +299,15 @@ let make {raw_election; metadata; featured; params_fname; public_keys_fname} = ...@@ -299,15 +299,15 @@ let make {raw_election; metadata; featured; params_fname; public_keys_fname} =
~scope:Eliom_common.default_session_scope ~scope:Eliom_common.default_session_scope
(None : string option) (None : string option)
let if_eligible get_user acl f () x = let if_eligible acl f () x =
lwt user = get_user () in lwt user = S.get_user () in
if acl metadata user then if acl metadata user then
f user x f user x
else else
forbidden () forbidden ()
let () = Html5.register ~service:W.S.home let () = Html5.register ~service:W.S.home
(if_eligible S.get_user can_read (if_eligible can_read
(fun user () -> (fun user () ->
let module X = struct let s = W.S.home end in let module X = struct let s = W.S.home end in
let x = (module X : SAVED_SERVICE) in let x = (module X : SAVED_SERVICE) in
...@@ -361,10 +361,10 @@ let make {raw_election; metadata; featured; params_fname; public_keys_fname} = ...@@ -361,10 +361,10 @@ let make {raw_election; metadata; featured; params_fname; public_keys_fname} =
let handle_pseudo_file u f = let handle_pseudo_file u f =
let open Eliom_registration in let open Eliom_registration in
let file f = let file f =
if_eligible S.get_user can_read f u () >>= if_eligible can_read f u () >>=
File.send ~content_type:"application/json" File.send ~content_type:"application/json"
and stream f = and stream f =
if_eligible S.get_user can_read f u () >>= if_eligible can_read f u () >>=
Streamlist.send >>= Streamlist.send >>=
(fun x -> return (cast_unknown_content_kind x)) (fun x -> return (cast_unknown_content_kind x))
in in
...@@ -420,7 +420,7 @@ let make {raw_election; metadata; featured; params_fname; public_keys_fname} = ...@@ -420,7 +420,7 @@ let make {raw_election; metadata; featured; params_fname; public_keys_fname} =
let () = Redirection.register let () = Redirection.register
~service:W.S.election_vote ~service:W.S.election_vote
(if_eligible S.get_user can_read (if_eligible can_read
(fun user () -> (fun user () ->
Eliom_reference.unset ballot >> Eliom_reference.unset ballot >>
let module X = struct let s = W.S.election_vote end in let module X = struct let s = W.S.election_vote end in
...@@ -476,7 +476,7 @@ let make {raw_election; metadata; featured; params_fname; public_keys_fname} = ...@@ -476,7 +476,7 @@ let make {raw_election; metadata; featured; params_fname; public_keys_fname} =
let () = Html5.register let () = Html5.register
~service:W.S.election_cast ~service:W.S.election_cast
(if_eligible S.get_user can_read (if_eligible can_read
(fun user () -> (fun user () ->
let uuid = W.election.e_params.e_uuid in let uuid = W.election.e_params.e_uuid in
let module X = struct let s = W.S.election_cast end in let module X = struct let s = W.S.election_cast end in
...@@ -490,7 +490,7 @@ let make {raw_election; metadata; featured; params_fname; public_keys_fname} = ...@@ -490,7 +490,7 @@ let make {raw_election; metadata; featured; params_fname; public_keys_fname} =
let () = Redirection.register let () = Redirection.register
~service:W.S.election_cast_post ~service:W.S.election_cast_post
(if_eligible S.get_user can_read (if_eligible can_read
(fun user (ballot_raw, ballot_file) -> (fun user (ballot_raw, ballot_file) ->
lwt the_ballot = match ballot_raw, ballot_file with lwt the_ballot = match ballot_raw, ballot_file with
| Some ballot, None -> return ballot | Some ballot, None -> return ballot
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment