Maj terminée. Pour consulter la release notes associée voici le lien :
https://about.gitlab.com/releases/2021/07/07/critical-security-release-gitlab-14-0-4-released/

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

Drop ACLs

They were largely unused and untested.
parent da6bd298
......@@ -149,27 +149,10 @@ let set_rewrite_prefix ~src ~dst =
let empty_metadata = {
e_voting_starts_at = None;
e_voting_ends_at = None;
e_readers = None;
e_voters = None;
e_owner = None;
e_auth_config = None;
}
let check_acl a u =
match a with
| Some `Any -> true
| Some (`Many items) ->
let rec loop = function
| [] -> false
| item :: _ when item.acl_domain = u.user_domain ->
(match item.acl_users with
| `Any -> true
| `Many users -> SSet.mem u.user_name users
)
| _ :: xs -> loop xs
in loop items
| _ -> false
let uuid = Eliom_parameter.user_type
~of_string:(fun x -> match Uuidm.of_string x with
| Some x -> x
......
......@@ -68,8 +68,6 @@ val set_rewrite_prefix : src:string -> dst:string -> unit
val empty_metadata : metadata
val check_acl : acl option -> user -> bool
type election_file =
| ESRaw
| ESKeys
......
......@@ -39,21 +39,6 @@ type user = {
name : string;
} <ocaml field_prefix="user_">
type names =
[ Any
| Many of string_set
]
type acl_item = {
domain : string;
users : names;
} <ocaml field_prefix="acl_">
type acl =
[ Any
| Many of acl_item list
]
type auth_config = {
auth_system : string;
auth_instance : string;
......@@ -63,8 +48,6 @@ type auth_config = {
type metadata = {
?voting_starts_at : datetime option;
?voting_ends_at : datetime option;
?readers : acl option;
?voters : acl option;
?owner: user option;
?auth_config: auth_config list option;
} <ocaml field_prefix="e_">
......
......@@ -340,8 +340,6 @@ let () = Redirection.register ~service:election_setup_new
let se_metadata = {
e_voting_starts_at = None;
e_voting_ends_at = None;
e_readers = Some `Any;
e_voters = Some `Any;
e_owner = Some u;
e_auth_config = Some [{auth_system = "dummy"; auth_instance = "demo"; auth_config = []}];
} in
......
......@@ -521,33 +521,6 @@ let election_home w state () =
let module W = (val w : WEB_ELECTION) 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
| None ->
(match m.e_voters with
| Some `Any ->
return [
pcdata "Anybody can vote in this election.";
]
| Some _ ->
return [
pcdata "Log in to check if you can vote. ";
pcdata "Alternatively, you can try to vote and ";
pcdata "log in at the last moment.";
]
| None ->
return [
pcdata "Currently, nobody can vote in this election.";
]
)
| Some u ->
let can = if check_acl m.e_voters u then "can" else "cannot" in
Lwt.return [
pcdata "You ";
pcdata can;
pcdata " vote in this election.";
]
in
let voting_period =
match m.e_voting_starts_at, m.e_voting_ends_at with
| None, None ->
......@@ -646,7 +619,6 @@ let election_home w state () =
] in
let content = [
p (voting_period @ state);
p permissions;
br ();
div ~a:[a_style "text-align:center;"] [
div [
......
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