7#include <bsoncxx/json.hpp>
8#include <bsoncxx/types.hpp>
9#include <mongocxx/client.hpp>
10#include <mongocxx/stdx.hpp>
11#include <mongocxx/uri.hpp>
12#include <mongocxx/instance.hpp>
13#include <bsoncxx/builder/stream/helpers.hpp>
14#include <bsoncxx/builder/stream/document.hpp>
15#include <bsoncxx/builder/stream/array.hpp>
20using bsoncxx::builder::stream::close_array;
21using bsoncxx::builder::stream::close_document;
22using bsoncxx::builder::stream::document;
23using bsoncxx::builder::stream::finalize;
24using bsoncxx::builder::stream::open_array;
25using bsoncxx::builder::stream::open_document;
26using bsoncxx::document::value;
27using bsoncxx::document::view;
28using bsoncxx::document::element;
42 void createGroup(std::string groupName,
User& creatingUser, mongocxx::client& adminClient);
47 std::vector<Group>
getAllGroups(
User& loggedInUser, mongocxx::client& userClient);
55 bool changeGroupName(std::string oldName, std::string newName, mongocxx::client& adminClient);
59 bool addUserToGroup(
User& loggedInUser, std::string groupName, mongocxx::client& adminClient);
Definition MongoGroupFunctions.h:41
std::string groupsToJson(std::vector< Group > &groups)
Definition MongoGroupFunctions.cpp:453
Group getGroupDataById(std::string groupId, mongocxx::client &userClient)
Definition MongoGroupFunctions.cpp:202
bool changeGroupName(std::string oldName, std::string newName, mongocxx::client &adminClient)
Definition MongoGroupFunctions.cpp:244
void createGroup(std::string groupName, User &creatingUser, mongocxx::client &adminClient)
Definition MongoGroupFunctions.cpp:22
std::string generateUniqueGroupName(mongocxx::client &adminClient)
Definition MongoGroupFunctions.cpp:70
bool removeGroup(Group &groupToBeRemoved, mongocxx::client &adminClient)
Definition MongoGroupFunctions.cpp:421
bool changeGroupOwner(Group &group, User &oldUser, User &newUser, mongocxx::client &adminClient)
Definition MongoGroupFunctions.cpp:276
bool removeUserFromGroup(User &loggedInUser, std::string groupName, mongocxx::client &adminClient)
Definition MongoGroupFunctions.cpp:380
std::vector< Group > getAllGroups(User &loggedInUser, mongocxx::client &userClient)
Definition MongoGroupFunctions.cpp:129
bool addUserToGroup(User &loggedInUser, std::string groupName, mongocxx::client &adminClient)
Definition MongoGroupFunctions.cpp:334
std::string groupToJson(Group &grp)
Definition MongoGroupFunctions.cpp:442
size_t getAllGroupCount(User &loggedInUser, mongocxx::client &userClient)
Definition MongoGroupFunctions.cpp:149
Group getGroupDataByName(std::string groupName, mongocxx::client &userClient)
Definition MongoGroupFunctions.cpp:160
std::vector< Group > getAllUserGroups(User &loggedInUser, mongocxx::client &userClient)
Definition MongoGroupFunctions.cpp:107