Used in DB IDO and Livestatus. */
| 213 | |
| 214 | /* Used in DB IDO and Livestatus. */ |
| 215 | std::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. */ |
| 238 | std::set<UserGroup::Ptr> CompatUtility::GetCheckableNotificationUserGroups(const Checkable::Ptr& checkable) |
nothing calls this directly
no test coverage detected