Commit ef197a11 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Export Auth in WEB_ELECTION

parent 302a3c9a
......@@ -270,7 +270,7 @@ module Make (D : ELECTION_DATA) (P : WEB_PARAMS) : REGISTRABLE = struct
end
module S = Auth.Services
module Auth = Auth
end
......@@ -291,7 +291,7 @@ module Make (D : ELECTION_DATA) (P : WEB_PARAMS) : REGISTRABLE = struct
module T = Web_templates
let if_eligible acl f () x =
lwt user = W.S.get_user () in
lwt user = W.Auth.Services.get_user () in
if acl W.metadata user then
f user x
else
......@@ -412,7 +412,7 @@ module Make (D : ELECTION_DATA) (P : WEB_PARAMS) : REGISTRABLE = struct
| Some the_ballot ->
begin
Eliom_reference.unset ballot >>
match_lwt W.S.get_user () with
match_lwt W.Auth.Services.get_user () with
| Some u ->
let b = check_acl W.metadata.e_voters u in
if b then (
......@@ -480,7 +480,7 @@ module Make (D : ELECTION_DATA) (P : WEB_PARAMS) : REGISTRABLE = struct
)
let election_pretty_ballots start () =
lwt user = W.S.get_user () in
lwt user = W.Auth.Services.get_user () in
if can_read W.metadata user then (
lwt res, _ =
W.B.Ballots.fold
......@@ -493,7 +493,7 @@ module Make (D : ELECTION_DATA) (P : WEB_PARAMS) : REGISTRABLE = struct
) else forbidden ()
let election_pretty_ballot hash () =
lwt user = W.S.get_user () in
lwt user = W.Auth.Services.get_user () in
if can_read W.metadata user then (
lwt ballot =
W.B.Ballots.fold
......
......@@ -126,8 +126,11 @@ module type WEB_ELECTION_ = sig
include ELECTION_DATA
include WEB_PARAMS
module E : ELECTION with type elt = G.t
module S : AUTH_SERVICES
module B : WEB_BALLOT_BOX
module Auth : sig
module Services : AUTH_SERVICES
module Handlers : AUTH_HANDLERS
end
end
module type WEB_ELECTION = sig
......
......@@ -498,7 +498,7 @@ let election_setup_trustee token uuid se () =
let election_login_box w =
let module W = (val w : WEB_ELECTION_) in
let auth = (module W.S : AUTH_SERVICES) in
let auth = (module W.Auth.Services : AUTH_SERVICES) in
let module L = struct
let login x =
Eliom_service.preapply
......@@ -520,7 +520,7 @@ let file w x =
let election_home w state () =
let module W = (val w : WEB_ELECTION_) in
lwt user = W.S.get_user () in
lwt user = W.Auth.Services.get_user () in
let params = W.election.e_params and m = W.metadata in
lwt permissions =
match user with
......@@ -757,7 +757,7 @@ let cast_raw w () =
let cast_confirmation w ~can_vote hash () =
let module W = (val w : WEB_ELECTION_) in
lwt user = W.S.get_user () in
lwt user = W.Auth.Services.get_user () in
let params = W.election.e_params in
let name = params.e_name in
let user_div = match user with
......
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