26 #include "core/auth/User_odb.h"    50     using Query = odb::query<Auth::User>;
    52     odb::transaction t(db->begin());
    53     json attributes = req.at(
"attributes");
    56     new_user->username(attributes.at(
"username"));
    57     if (db->query_one<
Auth::User>(Query::username == new_user->username()))
    59                              BUILD_STR(
"The username " << new_user->username()
    60                                                        << 
" is already in use."));
    63     db->persist(new_user);
    81     using Result = odb::result<Auth::User>;
    83     odb::transaction t(db->begin());
    96         rep[
"data"]   = json::array();
    97         for (
const auto &user : result)
    99             rep[
"data"].push_back(
   112     odb::transaction t(db->begin());
   114     auto attributes = req.at(
"attributes");
   123     bool enabled_status = user->validity().is_enabled();
   127     if (enabled_status && !user->validity().is_enabled() &&
   146 std::vector<CRUDResourceHandler::ActionActionParam>
   149     std::vector<CRUDResourceHandler::ActionActionParam> ret;
   156     catch (
const json::out_of_range &e)
 static IUserEventPtr UserEvent(const DBPtr &database, Auth::UserPtr target_user, IAuditEntryPtr parent)
 
static json serialize(const Auth::User &in, const SecurityContext &sc)
 
An exception class for general API error. 
 
This is the header file for a generated source file, GitSHA1.cpp. 
 
static SecurityContext & instance()
 
virtual boost::optional< json > create_impl(const json &req) override
 
virtual UserSecurityContext & security_context() const override
Helper function that returns the security context. 
 
Audit::IAuditEntryPtr audit
The initial audit trail for the request. 
 
std::unique_ptr< CRUDResourceHandler > CRUDResourceHandlerUPtr
 
virtual boost::optional< json > update_impl(const json &req) override
Update information about a given user. 
 
static CRUDResourceHandlerUPtr instanciate(RequestContext)
 
bool is_self(Auth::UserId id) const
Return true if the owner of the security context is the user whose id is id. 
 
UserCRUD(RequestContext ctx)
 
std::shared_ptr< IUserEvent > IUserEventPtr
 
odb::query< Tools::LogEntry > Query
 
std::shared_ptr< User > UserPtr
 
All modules that provides features to Leosac shall be in this namespace. 
 
static std::string serialize(const Auth::User &in, const SecurityContext &sc)
 
static void unserialize(Auth::User &out, const json &in, const SecurityContext &sc)
 
Base CRUD handler for use within the websocket module. 
 
virtual std::vector< ActionActionParam > required_permission(Verb verb, const json &req) const override
 
virtual boost::optional< json > read_impl(const json &req) override
Retrieve information about a given user, or about all users. 
 
#define BUILD_STR(param)
Internal macro. 
 
A base class for Leosac specific exception. 
 
virtual boost::optional< json > delete_impl(const json &req) override
 
odb::result< Tools::LogEntry > Result
 
Holds valuable pointer to provide context to a request. 
 
std::shared_ptr< odb::database > DBPtr