Leosac  0.8.0
Open Source Access Control
Leosac::Tools::ScheduleMapping Struct Reference

Represent one of the mapping of a schedule. More...

#include <ScheduleMapping.hpp>

+ Inheritance diagram for Leosac::Tools::ScheduleMapping:
+ Collaboration diagram for Leosac::Tools::ScheduleMapping:

Public Member Functions

ScheduleMappingId id () const
 
const std::string & alias () const
 
void alias (const std::string &)
 
ScheduleId schedule_id () const
 Retrieve the id of the owning schedule. More...
 
ScheduleLWPtr schedule () const
 
const std::vector< Auth::UserLWPtr > & users () const
 
const std::vector< Auth::GroupLWPtr > & groups () const
 
const std::vector< Cred::CredentialLWPtr > & credentials () const
 
const std::vector< Auth::DoorLWPtr > & doors () const
 
size_t odb_version () const
 
bool has_user (Auth::UserId) const
 Check if the user with id uid is directly part of the mapping. More...
 
bool has_group (Auth::GroupId) const
 Check if the group is directly mapping by the ScheduleMapping object. More...
 
bool has_cred (Cred::CredentialId) const
 Check if the credential is mapped by this ScheduleMapping. More...
 
bool has_door (Auth::DoorId) const
 Check if the door is mapped by this object. More...
 
bool has_user_indirect (Auth::UserPtr) const
 Check wether the user is mapped, either directly or not, by this ScheduleMapping object. More...
 
void add_door (const Auth::DoorLPtr &door)
 Add a door to the mapping. More...
 
void clear_doors ()
 
void add_user (const Auth::UserLPtr &user)
 Add a user to the mapping. More...
 
void clear_users ()
 
void add_group (const Auth::GroupLPtr &group)
 Add a group to the mapping. More...
 
void clear_groups ()
 
void add_credential (const Cred::CredentialLPtr &cred)
 Add a credential to the mapping. More...
 
void clear_credential ()
 

Public Attributes

ScheduleMappingId id_
 

Protected Attributes

std::vector< Auth::UserLWPtrusers_
 
std::vector< Auth::GroupLWPtrgroups_
 
std::vector< Cred::CredentialLWPtrcreds_
 
std::vector< Auth::DoorLWPtrdoors_
 
ScheduleLWPtr schedule_
 The schedule that owns the mapping. More...
 
std::string alias_
 A non unique, optional alias. More...
 
size_t odb_version_
 

Friends

class Schedule
 
class odb::access
 

Detailed Description

Represent one of the mapping of a schedule.

This object is designed to be embedded into Schedule object.

Definition at line 37 of file ScheduleMapping.hpp.

Member Function Documentation

◆ add_credential()

void ScheduleMapping::add_credential ( const Cred::CredentialLPtr cred)

Add a credential to the mapping.

This call will notify the credential object (when possible) that it has been added to the mapping.

Definition at line 151 of file ScheduleMapping.cpp.

◆ add_door()

void ScheduleMapping::add_door ( const Auth::DoorLPtr door)

Add a door to the mapping.

This call properly notify the door object (if eager) that a ScheduleMapping has added it into its mapping.

Definition at line 124 of file ScheduleMapping.cpp.

◆ add_group()

void ScheduleMapping::add_group ( const Auth::GroupLPtr group)

Add a group to the mapping.

This call will notify the group object (when possible) that it has been added to the mapping.

Definition at line 142 of file ScheduleMapping.cpp.

◆ add_user()

void ScheduleMapping::add_user ( const Auth::UserLPtr user)

Add a user to the mapping.

This call will notify the user object (when possible) that it has been added to the mapping.

Definition at line 133 of file ScheduleMapping.cpp.

◆ alias() [1/2]

const std::string & ScheduleMapping::alias ( ) const

Definition at line 40 of file ScheduleMapping.cpp.

◆ alias() [2/2]

void ScheduleMapping::alias ( const std::string &  a)

Definition at line 45 of file ScheduleMapping.cpp.

◆ clear_credential()

void ScheduleMapping::clear_credential ( )

Definition at line 195 of file ScheduleMapping.cpp.

◆ clear_doors()

void ScheduleMapping::clear_doors ( )

Definition at line 180 of file ScheduleMapping.cpp.

◆ clear_groups()

void ScheduleMapping::clear_groups ( )

Definition at line 190 of file ScheduleMapping.cpp.

◆ clear_users()

void ScheduleMapping::clear_users ( )

Definition at line 185 of file ScheduleMapping.cpp.

◆ credentials()

const std::vector< Cred::CredentialLWPtr > & ScheduleMapping::credentials ( ) const

Definition at line 170 of file ScheduleMapping.cpp.

◆ doors()

const std::vector< Auth::DoorLWPtr > & ScheduleMapping::doors ( ) const

Definition at line 175 of file ScheduleMapping.cpp.

◆ groups()

const std::vector< Auth::GroupLWPtr > & ScheduleMapping::groups ( ) const

Definition at line 165 of file ScheduleMapping.cpp.

◆ has_cred()

bool ScheduleMapping::has_cred ( Cred::CredentialId  cid) const

Check if the credential is mapped by this ScheduleMapping.

Definition at line 82 of file ScheduleMapping.cpp.

◆ has_door()

bool ScheduleMapping::has_door ( Auth::DoorId  did) const

Check if the door is mapped by this object.

Definition at line 92 of file ScheduleMapping.cpp.

◆ has_group()

bool ScheduleMapping::has_group ( Auth::GroupId  gid) const

Check if the group is directly mapping by the ScheduleMapping object.

Definition at line 72 of file ScheduleMapping.cpp.

◆ has_user()

bool ScheduleMapping::has_user ( Auth::UserId  uid) const

Check if the user with id uid is directly part of the mapping.

Definition at line 62 of file ScheduleMapping.cpp.

◆ has_user_indirect()

bool ScheduleMapping::has_user_indirect ( Auth::UserPtr  user) const

Check wether the user is mapped, either directly or not, by this ScheduleMapping object.

Being mapped indirectly means that either at least one of the user's groups or credential is mapped.

Definition at line 102 of file ScheduleMapping.cpp.

◆ id()

ScheduleMappingId ScheduleMapping::id ( ) const

Definition at line 35 of file ScheduleMapping.cpp.

◆ odb_version()

size_t ScheduleMapping::odb_version ( ) const

Definition at line 200 of file ScheduleMapping.cpp.

◆ schedule()

ScheduleLWPtr ScheduleMapping::schedule ( ) const

Definition at line 57 of file ScheduleMapping.cpp.

◆ schedule_id()

ScheduleId ScheduleMapping::schedule_id ( ) const

Retrieve the id of the owning schedule.

Definition at line 50 of file ScheduleMapping.cpp.

◆ users()

const std::vector< Auth::UserLWPtr > & ScheduleMapping::users ( ) const

Definition at line 160 of file ScheduleMapping.cpp.

Friends And Related Function Documentation

◆ odb::access

friend class odb::access
friend

Definition at line 168 of file ScheduleMapping.hpp.

◆ Schedule

friend class Schedule
friend

Definition at line 167 of file ScheduleMapping.hpp.

Member Data Documentation

◆ alias_

std::string Leosac::Tools::ScheduleMapping::alias_
protected

A non unique, optional alias.

Definition at line 161 of file ScheduleMapping.hpp.

◆ creds_

std::vector<Cred::CredentialLWPtr> Leosac::Tools::ScheduleMapping::creds_
protected

Definition at line 145 of file ScheduleMapping.hpp.

◆ doors_

std::vector<Auth::DoorLWPtr> Leosac::Tools::ScheduleMapping::doors_
protected

Definition at line 150 of file ScheduleMapping.hpp.

◆ groups_

std::vector<Auth::GroupLWPtr> Leosac::Tools::ScheduleMapping::groups_
protected

Definition at line 140 of file ScheduleMapping.hpp.

◆ id_

ScheduleMappingId Leosac::Tools::ScheduleMapping::id_

Definition at line 129 of file ScheduleMapping.hpp.

◆ odb_version_

size_t Leosac::Tools::ScheduleMapping::odb_version_
protected

Definition at line 164 of file ScheduleMapping.hpp.

◆ schedule_

ScheduleLWPtr Leosac::Tools::ScheduleMapping::schedule_
protected

The schedule that owns the mapping.

Definition at line 156 of file ScheduleMapping.hpp.

◆ users_

std::vector<Auth::UserLWPtr> Leosac::Tools::ScheduleMapping::users_
protected

Definition at line 135 of file ScheduleMapping.hpp.


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