Module User_sql

module User_sql : sig..end

The abstract type of user ids


module Types : sig..end
exception NotAnUser

Exception raised when a string cannot be translated into a real user

val new_user : 
  name:string ->
  password:Types.pwd ->
  fullname:string ->
  email:string option ->
  dyn:bool -> (Types.userid * Types.pwd) Lwt.t

Creates a user. The password passed as argument must be unencrypted. Returns the user id and its password after an eventual encryption.

val new_parameterized_group : 
  prefix:string ->
  name:string ->
  descr:string ->
  find_param:Types.find_param ->
  'a Types.parameterized_group Lwt.t
val new_nonparameterized_group : 
  prefix:string ->
  name:string -> descr:string -> Types.user Lwt.t
exception NotBasicUser of Types.userdata
val get_basicuser_by_login : string -> Types.userid Lwt.t
val get_basicuser_data : Types.userid -> Types.userdata Lwt.t
val get_parameterized_user_data : 
  'a Types.parameterized_group -> Types.userdata Lwt.t
val get_user_data : Types.user -> Types.userdata Lwt.t
val groups_of_user : user:Types.user -> Types.user list Lwt.t

Returns the groups in which a user is directly included

val users_in_group : 
  ?generic:bool ->
  group:Types.user -> Types.user list Lwt.t

Returns the users or groups inside a group. If generic is false, inclusions coming from generic edges are not returned

val add_to_group : user:Types.user -> group:Types.user -> unit Lwt.t
val remove_from_group : user:Types.user -> group:Types.user -> unit Lwt.t
val add_generic_inclusion : 
  subset:'a Types.parameterized_group ->
  superset:'a Types.parameterized_group -> unit Lwt.t
val add_to_group_generic : 
  user:'a Types.parameterized_group ->
  group:'a Types.parameterized_group -> unit Lwt.t

Same as add_generic_inclusion. Use the one you prefer.

val delete_user : userid:Types.userid -> unit Lwt.t
val update_data : 
  userid:Types.userid ->
  ?password:Types.pwd ->
  ?fullname:string ->
  ?email:string option -> ?dyn:bool -> unit -> unit Lwt.t
val userid_to_string : Types.userid -> string Lwt.t

Converts an userid to a string, by giving the corresponding login field. Raises Not_found if the user does not exists.

val user_to_string : ?expand_param:bool -> Types.user -> string Lwt.t

Converts an user to a string. Basic users are converted as per userid_to_string. Groups are written #group(val) where group is the name used at the creation of the group, and val is the int32 parameter of the group. If expand_param is true the function tries to convert int32 into a string, using the functions passed as arguments when #group was defined.

val get_user_by_name : string -> Types.user Lwt.t

Returns the user that corresponds to a given string (inverse of the function user_to_string, or raises Not_found if the user does not exists

val all_users : unit -> Types.users Lwt.t

Returns a list of all the existing users and groups.

val user_type : Types.user -> [ `Group | `Role | `User ] Lwt.t

Users settings

type user_settings = {
  basicusercreation: bool;  registration_mail_from: string;  registration_mail_addr: string;  registration_mail_subject: string;  groups: string;  non_admin_can_create: bool;}
val get_users_settings : unit -> user_settings Lwt.t
val set_users_settings : user_settings -> unit Lwt.t
val get_users_login : 
  unit ->
  < id : < get : unit; nul : Sql.non_nullable; t : Sql.int32_t > Sql.t;
   title : < get : unit; nul : Sql.nullable; t : Sql.string_t > Sql.t >
  list Lwt.t