Leosac  0.8.0
Open Source Access Control
Leosac::Cred::Credential Class Reference

An ODB enabled credential object. More...

#include <Credential.hpp>

+ Inheritance diagram for Leosac::Cred::Credential:
+ Collaboration diagram for Leosac::Cred::Credential:

Public Member Functions

 Credential ()
 
virtual Auth::UserLPtr owner () const override
 Retrieve the owner of the credential. More...
 
virtual void owner (Auth::UserLPtr ptr) override
 Set a new owner for the credential. More...
 
virtual std::string alias () const override
 An alias for the credential. More...
 
virtual CredentialId id () const override
 Retrieve the identifier of the credential. More...
 
virtual void id (const CredentialId &new_id) override
 Manually set the identifier of a credential. More...
 
virtual size_t odb_version () const override
 Credentials are "optimistic" object (wrt ODB). More...
 
virtual Auth::UserId owner_id () const override
 Returns the id of the owner, or 0 if there is no owner (or the owner has no id). More...
 
virtual void alias (const std::string &id) override
 Set the alias for the credential. More...
 
virtual std::string description () const override
 An optional description / notes for the credential. More...
 
virtual void description (const std::string &str) override
 Set a description for this credential. More...
 
virtual void validity (const Auth::ValidityInfo &info) override
 Provide the validity info object to the credential. More...
 
virtual const Auth::ValidityInfovalidity () const override
 Retrieve validity status from the credential. More...
 
virtual std::vector< Tools::ScheduleMappingLWPtrlazy_schedules_mapping () const override
 Retrieve the lazy_weak_ptr to ScheduleMapping that map this credential. More...
 
void schedule_mapping_added (const Tools::ScheduleMappingPtr &sched_mapping)
 The credential has been mapped by a schedule. More...
 
- Public Member Functions inherited from Leosac::Cred::ICredential
 MAKE_VISITABLE ()
 
- Public Member Functions inherited from Leosac::Tools::IVisitable
virtual void accept (::Leosac::Tools::BaseVisitor &)=0
 Accept a visitor that may mutate this. More...
 
virtual void accept (::Leosac::Tools::BaseVisitor &) const =0
 Accept a visitor that will not mutate this. More...
 

Protected Attributes

CredentialId id_
 
Auth::UserLPtr owner_
 
std::string alias_
 
std::string description_
 
Auth::ValidityInfo validity_
 
std::vector< Tools::ScheduleMappingLWPtrschedules_mapping_
 
size_t odb_version_
 

Friends

class odb::access
 
class ::Leosac::TestAccess
 

Additional Inherited Members

- Static Protected Member Functions inherited from Leosac::Tools::IVisitable
template<class T >
static bool visitor_dispatch (T &visited, BaseVisitor &visitor, bool abort_on_failure)
 

Detailed Description

An ODB enabled credential object.

Definition at line 37 of file Credential.hpp.

Constructor & Destructor Documentation

◆ Credential()

Credential::Credential ( )

Definition at line 27 of file Credential.cpp.

Member Function Documentation

◆ alias() [1/2]

std::string Credential::alias ( ) const
overridevirtual

An alias for the credential.

Implements Leosac::Cred::ICredential.

Definition at line 43 of file Credential.cpp.

◆ alias() [2/2]

void Credential::alias ( const std::string &  )
overridevirtual

Set the alias for the credential.

Implements Leosac::Cred::ICredential.

Definition at line 70 of file Credential.cpp.

◆ description() [1/2]

std::string Credential::description ( ) const
overridevirtual

An optional description / notes for the credential.

Implements Leosac::Cred::ICredential.

Definition at line 76 of file Credential.cpp.

◆ description() [2/2]

void Credential::description ( const std::string &  )
overridevirtual

Set a description for this credential.

Implements Leosac::Cred::ICredential.

Definition at line 81 of file Credential.cpp.

◆ id() [1/2]

CredentialId Credential::id ( ) const
overridevirtual

Retrieve the identifier of the credential.

Implements Leosac::Cred::ICredential.

Definition at line 48 of file Credential.cpp.

◆ id() [2/2]

void Credential::id ( const CredentialId new_id)
overridevirtual

Manually set the identifier of a credential.

This should generally not be use when database interaction may happen.

Implements Leosac::Cred::ICredential.

Definition at line 53 of file Credential.cpp.

◆ lazy_schedules_mapping()

std::vector< Tools::ScheduleMappingLWPtr > Credential::lazy_schedules_mapping ( ) const
overridevirtual

Retrieve the lazy_weak_ptr to ScheduleMapping that map this credential.

Implements Leosac::Cred::ICredential.

Definition at line 96 of file Credential.cpp.

◆ odb_version()

size_t Credential::odb_version ( ) const
overridevirtual

Credentials are "optimistic" object (wrt ODB).

This means they carry a version field. This method returns the version.

Implements Leosac::Cred::ICredential.

Definition at line 58 of file Credential.cpp.

◆ owner() [1/2]

Auth::UserLPtr Credential::owner ( ) const
overridevirtual

Retrieve the owner of the credential.

Implements Leosac::Cred::ICredential.

Definition at line 33 of file Credential.cpp.

◆ owner() [2/2]

void Credential::owner ( Auth::UserLPtr  )
overridevirtual

Set a new owner for the credential.

Implements Leosac::Cred::ICredential.

Definition at line 38 of file Credential.cpp.

◆ owner_id()

Auth::UserId Credential::owner_id ( ) const
overridevirtual

Returns the id of the owner, or 0 if there is no owner (or the owner has no id).

Implements Leosac::Cred::ICredential.

Definition at line 63 of file Credential.cpp.

◆ schedule_mapping_added()

void Credential::schedule_mapping_added ( const Tools::ScheduleMappingPtr sched_mapping)

The credential has been mapped by a schedule.

See also
Auth::Door::schedule_mapping_added

Definition at line 101 of file Credential.cpp.

◆ validity() [1/2]

const Auth::ValidityInfo & Credential::validity ( ) const
overridevirtual

Retrieve validity status from the credential.

Implements Leosac::Cred::ICredential.

Definition at line 91 of file Credential.cpp.

◆ validity() [2/2]

void Credential::validity ( const Auth::ValidityInfo )
overridevirtual

Provide the validity info object to the credential.

Implements Leosac::Cred::ICredential.

Definition at line 86 of file Credential.cpp.

Friends And Related Function Documentation

◆ ::Leosac::TestAccess

friend class ::Leosac::TestAccess
friend

Definition at line 94 of file Credential.hpp.

◆ odb::access

friend class odb::access
friend

Definition at line 93 of file Credential.hpp.

Member Data Documentation

◆ alias_

std::string Leosac::Cred::Credential::alias_
protected

Definition at line 80 of file Credential.hpp.

◆ description_

std::string Leosac::Cred::Credential::description_
protected

Definition at line 82 of file Credential.hpp.

◆ id_

CredentialId Leosac::Cred::Credential::id_
protected

Definition at line 76 of file Credential.hpp.

◆ odb_version_

size_t Leosac::Cred::Credential::odb_version_
protected

Definition at line 90 of file Credential.hpp.

◆ owner_

Auth::UserLPtr Leosac::Cred::Credential::owner_
protected

Definition at line 78 of file Credential.hpp.

◆ schedules_mapping_

std::vector<Tools::ScheduleMappingLWPtr> Leosac::Cred::Credential::schedules_mapping_
protected

Definition at line 87 of file Credential.hpp.

◆ validity_

Auth::ValidityInfo Leosac::Cred::Credential::validity_
protected

Definition at line 84 of file Credential.hpp.


The documentation for this class was generated from the following files: