|
Leosac
0.8.0
Open Source Access Control
|
Go to the documentation of this file.
21 #include "core/audit/CredentialEvent_odb.h"
23 #include "core/credentials/Credential_odb.h"
32 std::shared_ptr<CredentialEvent>
37 ASSERT_LOG(target_cred,
"Credential shall not be null.");
38 ASSERT_LOG(target_cred->id(),
"Credential must be already persisted.");
45 audit->target(target_cred);
59 ASSERT_LOG(cred->id(),
"Credential has no id.");
61 auto cred_odb = std::dynamic_pointer_cast<Cred::Credential>(cred);
62 ASSERT_LOG(cred_odb,
"ICredential is not of type Credential.");
101 using namespace FlagSetOperator;
102 std::stringstream ss;
125 desc[
"alias"] = t->alias();
std::string generate_target_description() const
virtual void author(Auth::UserPtr user) override
Set the author of the entry.
An optional transaction is an object that behave like an odb::transaction if there is no currently ac...
void commit()
Commit the transaction, if there was no currently active transaction at the time of this object's cre...
Cred::CredentialId target_cred_id_
std::shared_ptr< AuditEntry > AuditEntryPtr
#define ASSERT_LOG(cond, msg)
void database(DBPtr db)
Set the database pointer.
std::shared_ptr< odb::database > DBPtr
CredentialEvent()=default
virtual void target(Cred::ICredentialPtr cred) override
Set the user that is targeted by the event.
The Audit namespace provides classes and facilities to keep track of what's happening on the Leosac d...
This is the header file for a generated source file, GitSHA1.cpp.
Provides an implementation of ICredentialEvent.
Cred::CredentialId target_id() const override
virtual bool finalized() const override
Is this entry finalized.
static std::string type_name(const Cred::ICredential &in)
Returns the "type-name" of the credential.
std::string before_
Optional JSON dump of the object before the event took place.
Cred::CredentialLWPtr target_
virtual IAuditEntryPtr parent() const override
Retrieve the parent of this entry.
const std::string & before() const override
std::string generate_description() const override
Generate a description for this event.
std::string after_
Optional JSON dump of the object after the event took place.
std::shared_ptr< ICredential > ICredentialPtr
std::shared_ptr< CredentialEvent > CredentialEventPtr
unsigned long CredentialId
static std::shared_ptr< CredentialEvent > create_empty()
static std::shared_ptr< CredentialEvent > create(const DBPtr &database, Cred::ICredentialPtr target_cred, AuditEntryPtr parent)
const std::string & after() const override
Auth::UserLPtr author_
The user at the source of the entry.