Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
belenios
belenios
Commits
ef197a11
Commit
ef197a11
authored
Mar 21, 2015
by
Stephane Glondu
Browse files
Export Auth in WEB_ELECTION
parent
302a3c9a
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/web/web_election.ml
View file @
ef197a11
...
...
@@ -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
...
...
src/web/web_signatures.mli
View file @
ef197a11
...
...
@@ -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
...
...
src/web/web_templates.ml
View file @
ef197a11
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment