23 #include "repo_bson.h"
33 #define REPO_USER_LABEL_AVATAR "avatar"
34 #define REPO_USER_LABEL_CREDENTIALS "credentials"
35 #define REPO_USER_LABEL_CUSTOM_DATA "customData"
36 #define REPO_USER_LABEL_EMAIL "email"
37 #define REPO_USER_LABEL_FIRST_NAME "firstName"
38 #define REPO_USER_LABEL_LAST_NAME "lastName"
39 #define REPO_USER_LABEL_ENCRYPTION "MONGODB-CR"
40 #define REPO_USER_LABEL_CLEARTEXT "cleartext"
41 #define REPO_USER_LABEL_LABEL "label"
42 #define REPO_USER_LABEL_OWNER "account"
43 #define REPO_USER_LABEL_KEY "key"
44 #define REPO_USER_LABEL_PWD "pwd"
45 #define REPO_USER_LABEL_USER "user"
46 #define REPO_USER_LABEL_DB "db"
47 #define REPO_USER_LABEL_ROLES "roles"
48 #define REPO_USER_LABEL_ROLE "role"
49 #define REPO_USER_LABEL_API_KEYS "apiKeys"
50 #define REPO_USER_LABEL_SUBS "subscriptions"
51 #define REPO_USER_LABEL_SUBS_PLAN "plan"
52 #define REPO_USER_LABEL_SUBS_ID "_id"
53 #define REPO_USER_LABEL_SUBS_ACTIVE "active"
54 #define REPO_USER_LABEL_SUBS_CURRENT_AGREE "inCurrentAgreement"
55 #define REPO_USER_LABEL_SUBS_PENDING_DEL "pendingDelete"
56 #define REPO_USER_LABEL_SUBS_TOKEN "token"
57 #define REPO_USER_LABEL_SUBS_CREATED_AT "createdAt"
58 #define REPO_USER_LABEL_SUBS_UPDATED_AT "updatedAt"
59 #define REPO_USER_LABEL_SUBS_EXPIRES_AT "expiredAt"
60 #define REPO_USER_LABEL_SUBS_BILLING_USER "billingUser"
61 #define REPO_USER_LABEL_SUBS_ASSIGNED_USER "assignedUser"
62 #define REPO_USER_LABEL_SUBS_LIMITS "limits"
63 #define REPO_USER_LABEL_SUBS_LIMITS_COLLAB "collaboratorLimit"
64 #define REPO_USER_LABEL_SUBS_LIMITS_SPACE "spaceLimit"
67 #define REPO_USER_SUBS_STANDARD_FREE "BASIC"
76 bool inCurrentAgreement;
81 std::string billingUser;
82 std::string assignedUser;
85 int collaboratorLimit;
98 static SubscriptionInfo createDefaultSub(
99 const int64_t &expireTS = -1);
109 const std::string &dbName,
110 const std::string &role)
const;
128 RepoUser cloneAndUpdateLicenseCount(
130 const int64_t expDate = -1
133 RepoUser cloneAndUpdateSubscriptions(
134 const std::vector<SubscriptionInfo> &subs)
const;
144 std::list<std::pair<std::string, std::string> > getAPIKeysList()
const;
150 std::vector<char> getAvatarAsRawData()
const;
156 std::string getCleartextPassword()
const;
176 RepoBSON customData = getCustomDataBSON();
177 return customData.isEmpty() ?
"" : customData.getStringField(REPO_USER_LABEL_FIRST_NAME);
186 RepoBSON customData = getCustomDataBSON();
187 return customData.isEmpty() ?
"" : customData.getStringField(REPO_USER_LABEL_LAST_NAME);
196 return getStringField(REPO_USER_LABEL_USER);
205 RepoBSON customData = getCustomDataBSON();
206 return customData.isEmpty() ?
"" : customData.getStringField(REPO_USER_LABEL_EMAIL);
214 std::list<std::pair<std::string, std::string>> getLicenseAssignment()
const;
220 std::string getPassword()
const;
226 std::list<std::pair<std::string, std::string>>
227 getRolesList()
const;
233 std::vector<SubscriptionInfo> getSubscriptionInfo()
const;
239 uint32_t getNCollaborators()
const;
245 double getQuota()
const;
Definition: repo_connection_pool_mongo.h:32
std::string getFirstName() const
Definition: repo_bson_user.h:174
std::string getEmail() const
Definition: repo_bson_user.h:203
Definition: repo_bson.h:53
std::string getUserName() const
Definition: repo_bson_user.h:194
std::string getLastName() const
Definition: repo_bson_user.h:184
Definition: repo_bson_user.h:72
Definition: repo_bson_user.h:69