21 #include "core/audit/GroupEvent_odb.h" 34 ASSERT_LOG(database,
"Database cannot be null.");
35 ASSERT_LOG(target_group,
"Target group must be non null.");
36 ASSERT_LOG(target_group->id(),
"Target group must be already persisted.");
37 ASSERT_LOG(parent,
"Parent must be non null.");
38 ASSERT_LOG(parent->id(),
"Parent must be already persisted.");
45 audit->target(target_group);
46 database->persist(audit);
48 audit->set_parent(parent);
49 database->update(audit);
97 using namespace FlagSetOperator;
117 desc[
"name"] = t->name();
virtual void target(Auth::GroupPtr grp) override
Set the group that is targeted by the event.
const std::string & before() const override
const std::string & after() const override
Provides an implementation of IGroupEvent.
This is the header file for a generated source file, GitSHA1.cpp.
static std::shared_ptr< GroupEvent > create(const DBPtr &database, Auth::GroupPtr target_group, AuditEntryPtr parent)
std::string before_
Optional JSON dump of the object before the event took place.
virtual bool finalized() const override
Is this entry finalized.
An optional transaction is an object that behave like an odb::transaction if there is no currently ac...
Auth::GroupId target_id() const override
std::shared_ptr< Group > GroupPtr
static std::shared_ptr< GroupEvent > create_empty()
std::shared_ptr< AuditEntry > AuditEntryPtr
std::string generate_description() const override
Generate a description for this event.
#define ASSERT_LOG(cond, msg)
std::string after_
Optional JSON dump of the object after the event took place.
std::shared_ptr< odb::database > DBPtr
std::string generate_target_description() const
Generate a small json-string description about the targeted group.
Auth::GroupId target_group_id_
This is equals to target_->id().
std::shared_ptr< GroupEvent > GroupEventPtr
void database(DBPtr db)
Set the database pointer.
The Audit namespace provides classes and facilities to keep track of what's happening on the Leosac d...