Module Os_groupSource

include module type of struct include Os.Group end
Sourceexception No_such_group

Exception raised when no there is no group corresponding to the request (for example wrong ID or name).

Type alias to Types.Group.id to allow to use Group.id.

Sourceval id_to_json : Buffer.t -> id -> unit
Sourcetype t = Os.Types.Group.t = {
  1. id : id;
  2. name : string;
  3. desc : string option;
}

Type alias to Types.Group.t to allow to use Group.t.

Sourceval to_json : Buffer.t -> t -> unit

id_of_group group returns the group ID.

Sourceval name_of_group : Os.Types.Group.t -> string

name_of_group group returns the group name.

Sourceval desc_of_group : Os.Types.Group.t -> string option

desc_of_group group returns the group description.

Sourceval create : ?description:string -> string -> Os.Types.Group.t Lwt.t

create ~description name creates a new group in the database and returns it as a record of type Types.Group.t.

Sourceval group_of_name : string -> Os.Types.Group.t Lwt.t

Overwrites the function group_of_name of Db.Group and use the get function of the cache module.

Sourceval add_user_in_group : group:Os.Types.Group.t -> userid:Os.Types.User.id -> unit Lwt.t

add_user_in_group ~group ~userid adds the user with ID userid to group.

Sourceval remove_user_in_group : group:Os.Types.Group.t -> userid:Os.Types.User.id -> unit Lwt.t

remove_user_in_group ~group ~userid removes the user with ID userid from group.

Sourceval in_group : ?dbh:Os.Db.PGOCaml.pa_pg_data Os.Db.PGOCaml.t -> group:Os.Types.Group.t -> userid:Os.Types.User.id -> unit -> bool Lwt.t

in_group ~group ~userid returns true if the user with ID userid is in group.

Sourceval all : unit -> Os.Types.Group.t list Lwt.t

all () returns all the groups of the database.