23 #include "tools/Schedule_odb.h" 32 json memberships = {};
40 json group_info = {{
"id", membership->id()},
41 {
"type",
"user-group-membership"}};
42 memberships.push_back(group_info);
45 std::set<Tools::ScheduleId> schedule_ids;
49 auto loaded = mapping.load();
50 ASSERT_LOG(loaded,
"Cannot load. Need to investigate.");
51 schedule_ids.insert(loaded->schedule_id());
53 for (
const auto &
id : schedule_ids)
55 json sched_info = {{
"id",
id}, {
"type",
"schedule"}};
56 schedules.push_back(sched_info);
67 {{
"memberships", {{
"data", memberships}}},
68 {
"schedules", {{
"data", schedules}}}}}};
91 auto tmp = json::parse(in);
std::chrono::system_clock::time_point extract_with_default(const nlohmann::json &obj, const std::string &key, const std::chrono::system_clock::time_point &tp)
Extract an ISO 8601 datetime string from a json object.
GroupId id() const
Retrieve the unique identifier of the group.
std::vector< Tools::ScheduleMappingLWPtr > lazy_schedules_mapping() const
Returns the vector of lazy_weak_ptr to schedule mapping.
const UserGroupMembershipSet & user_memberships() const
Retrieve the UserGroupMembership that this group is involved with.
This is the header file for a generated source file, GitSHA1.cpp.
static json serialize(const Auth::Group &group, const SecurityContext &sc)
A authentication group regroup users that share permissions.
Add a few useful extraction functions.
const std::string & name() const
static std::string serialize(const Auth::Group &in, const SecurityContext &sc)
virtual bool check_permission(Action a, const ActionParam &ap) const
Check for the permission to perform action a with parameters ap.
static void unserialize(Auth::Group &out, const json &in, const SecurityContext &sc)
Holds classes relevant to the Authentication and Authorization subsystem.
A SecurityContext is used to query permission while doing an operation.
MembershipActionParam membership
#define ASSERT_LOG(cond, msg)
static void unserialize(Auth::Group &out, const std::string &in, const SecurityContext &sc)
const std::string & description() const
Auth::UserGroupMembershipId membership_id