25 #include "core/auth/Door_odb.h"    54     odb::transaction t(db->begin());
    60     db->persist(new_door);
    67     audit->access_point_id_after(new_door->access_point_id());
    79     using Result = odb::result<Auth::Door>;
    81     odb::transaction t(db->begin());
    92         rep[
"data"]       = json::array();
    96         for (
const auto &door : result)
    99             if (
ctx_.
session->security_context().check_permission(
   102                 rep[
"data"].push_back(
   115     odb::transaction t(db->begin());
   124     audit->access_point_id_before(door->access_point_id());
   129     db->update(door_odb);
   132     audit->access_point_id_after(door->access_point_id());
   144     odb::transaction t(db->begin());
   151     audit->access_point_id_before(door->access_point_id());
   162 std::vector<CRUDResourceHandler::ActionActionParam>
   165     std::vector<CRUDResourceHandler::ActionActionParam> ret;
   171     catch (json::out_of_range &e)
   200         odb::query<Auth::Door>::access_point == apid);
   206             "The AccessPoint with id {} is already referenced by door with id {}.",
 
virtual std::vector< ActionActionParam > required_permission(Verb verb, const json &req) const override
 
unsigned long AccessPointId
 
This is the header file for a generated source file, GitSHA1.cpp. 
 
static SecurityContext & instance()
 
static CRUDResourceHandlerUPtr instanciate(RequestContext)
 
virtual UserSecurityContext & security_context() const override
Helper function that returns the security context. 
 
Audit::IAuditEntryPtr audit
The initial audit trail for the request. 
 
virtual boost::optional< json > update_impl(const json &req) override
 
static json serialize(const Auth::IDoor &door, const SecurityContext &sc)
 
An optional transaction is an object that behave like an odb::transaction if there is no currently ac...
 
std::unique_ptr< CRUDResourceHandler > CRUDResourceHandlerUPtr
 
virtual boost::optional< json > delete_impl(const json &req) override
 
static void unserialize(Auth::IDoor &out, const json &in, const SecurityContext &sc)
 
static std::string serialize(const Auth::IDoor &in, const SecurityContext &sc)
 
void enforce_ap_not_already_referenced(Auth::AccessPointId apid)
Make sure that the AccessPoint with id apid is not already referenced by a door. 
 
virtual boost::optional< json > read_impl(const json &req) override
 
std::shared_ptr< Door > DoorPtr
 
#define LEOSAC_ENFORCE(cond,...)
Similar to enforce, except that it will throw a LEOSACException. 
 
All modules that provides features to Leosac shall be in this namespace. 
 
DoorCRUD(RequestContext ctx)
 
virtual boost::optional< json > create_impl(const json &req) override
 
Base CRUD handler for use within the websocket module. 
 
A base class for Leosac specific exception. 
 
odb::result< Tools::LogEntry > Result
 
Holds valuable pointer to provide context to a request. 
 
std::shared_ptr< odb::database > DBPtr
 
static IDoorEventPtr DoorEvent(const DBPtr &database, Auth::IDoorPtr target_door, IAuditEntryPtr parent)
 
std::enable_if_t< is_shared_ptr_v< Out >, Out > assert_cast(const std::shared_ptr< In > &in)
 
std::string format(const std::string &escape_code, const T &in)
Return a string containing the escape code, a string representation of T and the clear escape string...