|
Leosac
0.8.0
Open Source Access Control
|
Go to the documentation of this file.
28 const std::chrono::system_clock::time_point &date,
AuthTargetPtr target)
33 if (sched->is_in_schedule(date))
35 INFO(
"Access is granted through schedule '" << sched->name() <<
"'");
41 if (target &&
schedules_[target->name()].size())
43 for (
const auto &sched :
schedules_[target->name()])
45 if (sched->is_in_schedule(date))
47 INFO(
"Access is granted through schedule '" << sched->name() <<
"'");
64 std::map<std::string, std::vector<Leosac::Tools::IScheduleCPtr>>
const &
70 std::vector<Leosac::Tools::IScheduleCPtr>
const &
Holds classes relevant to the Authentication and Authorization subsystem.
std::map< std::string, std::vector< Tools::IScheduleCPtr > > schedules_
Map target name to target's schedules.
virtual const std::vector< Tools::IScheduleCPtr > & defaultSchedules() const
std::vector< Tools::IScheduleCPtr > default_schedule_
Schedule for default target.
std::shared_ptr< AuthTarget > AuthTargetPtr
virtual void addAccessSchedule(AuthTargetPtr target, const Tools::IScheduleCPtr &sched)
Adds a schedule where access to a given target is allowed.
virtual const std::map< std::string, std::vector< Tools::IScheduleCPtr > > & schedules() const
Returns the map of schedule for each target (except the default target)
virtual size_t schedule_count() const override
Returns the number of schedule associated with the profile.
virtual bool isAccessGranted(const std::chrono::system_clock::time_point &date, AuthTargetPtr target) override
Does the profile allow access to the user.
Leosac::Tools::SingleTimeFrame SingleTimeFrame