|
Leosac
0.8.0
Open Source Access Control
|
Go to the documentation of this file.
27 #include <odb/callback.hxx>
56 #pragma db object callback(odb_callback) optimistic
57 class Group :
public std::enable_shared_from_this<Group>
61 explicit Group(
const std::string &group_name);
75 const std::string &
name()
const;
81 const std::vector<UserPtr> &
members()
const;
127 void odb_callback(odb::callback_event e, odb::database &)
const;
137 #pragma db value_not_null inverse(group_)
140 #pragma db value_not_null inverse(groups_)
153 #pragma db type("VARCHAR(128)")
const UserGroupMembershipSet & user_memberships() const
Retrieve the UserGroupMembership that this group is involved with.
IAccessProfilePtr profile()
GroupId id() const
Retrieve the unique identifier of the group.
UserGroupMembershipSet membership_
std::vector< Tools::ScheduleMappingLWPtr > schedules_mapping_
std::shared_ptr< User > UserPtr
std::string description_
A (potentially long) description of the group.
std::shared_ptr< IAccessProfile > IAccessProfilePtr
std::vector< Tools::ScheduleMappingLWPtr > lazy_schedules_mapping() const
Returns the vector of lazy_weak_ptr to schedule mapping.
void odb_callback(odb::callback_event e, odb::database &) const
GroupId id_
The group identifier.
This is the header file for a generated source file, GitSHA1.cpp.
Validate a Group object's attributes, throwing ModelException if some attributes are invalid.
static void validate_name(const std::string &name)
UserGroupMembershipPtr member_add(UserPtr m, GroupRank rank=GroupRank::MEMBER)
A authentication group regroup users that share permissions.
bool member_has(Auth::UserId user_id, GroupRank *rank_out=nullptr) const
Check if user_id is a member of this group.
const std::string & name() const
std::shared_ptr< UserGroupMembership > UserGroupMembershipPtr
IAccessProfilePtr profile_
std::vector< UserPtr > loaded_members_
This returns a vector of loaded User object.
This is class that can be used to access some object's internal.
std::set< UserGroupMembershipPtr, UserGroupMembershipComparator > UserGroupMembershipSet
std::vector< UserLPtr > lazy_members() const
Retrieve lazy pointers to members.
GroupRank
The rank of an User inside a Group.
void schedule_mapping_added(const Tools::ScheduleMappingPtr &sched_mapping)
The group has been mapped by a schedule.
const std::vector< UserPtr > & members() const
static void validate(const Group &grp)
Validate the group's attributes.
const std::string & description() const