MCPcopy Create free account
hub / github.com/Icinga/icinga2 / GetCheckableNotificationUsers

Method GetCheckableNotificationUsers

lib/icinga/compatutility.cpp:215–235  ·  view source on GitHub ↗

Used in DB IDO and Livestatus. */

Source from the content-addressed store, hash-verified

213
214/* Used in DB IDO and Livestatus. */
215std::set<User::Ptr> CompatUtility::GetCheckableNotificationUsers(const Checkable::Ptr& checkable)
216{
217 /* Service -> Notifications -> (Users + UserGroups -> Users) */
218 std::set<User::Ptr> allUsers;
219 std::set<User::Ptr> users;
220
221 for (const Notification::Ptr& notification : checkable->GetNotifications()) {
222 ObjectLock olock(notification);
223
224 users = notification->GetUsers();
225
226 std::copy(users.begin(), users.end(), std::inserter(allUsers, allUsers.begin()));
227
228 for (const UserGroup::Ptr& ug : notification->GetUserGroups()) {
229 std::set<User::Ptr> members = ug->GetMembers();
230 std::copy(members.begin(), members.end(), std::inserter(allUsers, allUsers.begin()));
231 }
232 }
233
234 return allUsers;
235}
236
237/* Used in DB IDO and Livestatus. */
238std::set<UserGroup::Ptr> CompatUtility::GetCheckableNotificationUserGroups(const Checkable::Ptr& checkable)

Callers

nothing calls this directly

Calls 6

GetUsersMethod · 0.80
GetUserGroupsMethod · 0.80
GetNotificationsMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
GetMembersMethod · 0.45

Tested by

no test coverage detected