27 #include "tools/Schedule_odb.h"    49 std::vector<CRUDResourceHandler::ActionActionParam>
    51                                   const json &req)
 const    53     std::vector<CRUDResourceHandler::ActionActionParam> ret;
    59     catch (
const json::out_of_range &e)
    85     odb::transaction t(db->begin());
    91     db->persist(schedule);
   112 static void include_schedule_mapping_infos(
json &dest,
   116     ASSERT_LOG(dest.is_array(), 
"Destination is not array.");
   117     for (
const auto &mapping : schedule.
mapping())
   128     using Result = odb::result<Tools::Schedule>;
   130     odb::transaction t(db->begin());
   133     rep[
"included"] = json::array();
   141         include_schedule_mapping_infos(rep[
"included"], *schedule,
   147         rep[
"data"]   = json::array();
   148         for (
const auto &schedule : result)
   152             include_schedule_mapping_infos(rep[
"included"], schedule,
   163     odb::transaction t(db->begin());
   166     rep[
"included"] = json::array(); 
   179     for (
const auto &mapping : schedule->
mapping())
   183         for (
const auto &lazy_weak_door : mapping->doors())
   185             auto lazy_door = 
LEOSAC_ENFORCE(lazy_weak_door.load(), 
"Failed to load");
   188             door_event->finalize();
   194     for (
const auto &json_mapping : req.at(
"mapping"))
   197             std::make_shared<Tools::ScheduleMapping>();
   200         db->persist(mapping);
   203     include_schedule_mapping_infos(rep[
"included"], *schedule, 
security_context());
   205     db->update(assert_cast<Tools::SchedulePtr>(schedule));
   220     odb::transaction t(db->begin());
   233         for (
const auto &mapping : schedule->
mapping())
 
This is the header file for a generated source file, GitSHA1.cpp. 
 
static SecurityContext & instance()
 
This event is linked to door. 
 
Tools::ScheduleId schedule_id
 
virtual UserSecurityContext & security_context() const override
Helper function that returns the security context. 
 
Audit::IAuditEntryPtr audit
The initial audit trail for the request. 
 
static IScheduleEventPtr ScheduleEvent(const DBPtr &database, Tools::ISchedulePtr target_sched, IAuditEntryPtr parent)
 
std::unique_ptr< CRUDResourceHandler > CRUDResourceHandlerUPtr
 
virtual boost::optional< json > create_impl(const json &req) override
Create a new schedule. 
 
static CRUDResourceHandlerUPtr instanciate(RequestContext)
 
virtual std::vector< ActionActionParam > required_permission(Verb verb, const json &req) const override
 
std::shared_ptr< IScheduleEvent > IScheduleEventPtr
 
#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. 
 
A SecurityContext is used to query permission while doing an operation. 
 
virtual boost::optional< json > read_impl(const json &req) override
 
#define ASSERT_LOG(cond, msg)
 
ScheduleCRUD(RequestContext ctx)
 
Base CRUD handler for use within the websocket module. 
 
virtual boost::optional< json > update_impl(const json &req) override
Update a schedule object. 
 
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
 
static IDoorEventPtr DoorEvent(const DBPtr &database, Auth::IDoorPtr target_door, IAuditEntryPtr parent)