summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorSpencer Jackson <spencer.jackson@mongodb.com>2017-08-01 11:03:25 -0400
committerSpencer Jackson <spencer.jackson@mongodb.com>2017-08-01 11:32:36 -0400
commitecfc54c1bcc110b95c6f5dfd71e99f27bcbafea3 (patch)
treedf07a25d4fa13b0fabc22d0c97de53bc200dd6b5 /src/mongo
parent3394652848101167fdc16e30e98f99ea9c57c3f4 (diff)
downloadmongo-ecfc54c1bcc110b95c6f5dfd71e99f27bcbafea3.tar.gz
SERVER-29182: Ensure propagation of user ID in usersInfo
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/db/commands/user_management_commands.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mongo/db/commands/user_management_commands.cpp b/src/mongo/db/commands/user_management_commands.cpp
index 4e77d630159..65a9ffd3164 100644
--- a/src/mongo/db/commands/user_management_commands.cpp
+++ b/src/mongo/db/commands/user_management_commands.cpp
@@ -1231,11 +1231,9 @@ public:
// to be stripped out
BSONObjBuilder strippedUser(usersArrayBuilder.subobjStart());
for (const BSONElement& e : userDetails) {
- if (!args.showCredentials && e.fieldNameStringData() == "credentials") {
- continue;
- }
-
- if (e.fieldNameStringData() == AuthorizationManager::USER_ID_FIELD_NAME) {
+ if (!args.showCredentials &&
+ (e.fieldNameStringData() == "credentials" ||
+ e.fieldNameStringData() == AuthorizationManager::USER_ID_FIELD_NAME)) {
continue;
}