summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth
diff options
context:
space:
mode:
authorSara Golemon <sara.golemon@mongodb.com>2017-08-08 13:34:39 -0400
committerSara Golemon <sara.golemon@mongodb.com>2017-08-23 09:18:17 -0400
commita09f19822fb2a1e5b662bd8d542dd8e2f2607fc6 (patch)
tree4d396a07bdf8db1752aa4952211f4b46490459b7 /src/mongo/db/auth
parent3b8719aecf7541ee83738d9241bfcbc1281b6ed2 (diff)
downloadmongo-a09f19822fb2a1e5b662bd8d542dd8e2f2607fc6.tar.gz
SERVER-29628 $listLocalSessions aggregation stage
Diffstat (limited to 'src/mongo/db/auth')
-rw-r--r--src/mongo/db/auth/action_types.txt1
-rw-r--r--src/mongo/db/auth/authorization_session.cpp4
-rw-r--r--src/mongo/db/auth/role_graph_builtin_roles.cpp2
3 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/db/auth/action_types.txt b/src/mongo/db/auth/action_types.txt
index d3b2745d319..06185ac9de9 100644
--- a/src/mongo/db/auth/action_types.txt
+++ b/src/mongo/db/auth/action_types.txt
@@ -70,6 +70,7 @@
"listCollections",
"listDatabases",
"listIndexes",
+"listSessions",
"listShards",
"logRotate",
"moveChunk",
diff --git a/src/mongo/db/auth/authorization_session.cpp b/src/mongo/db/auth/authorization_session.cpp
index 201acb11b00..86cba41f616 100644
--- a/src/mongo/db/auth/authorization_session.cpp
+++ b/src/mongo/db/auth/authorization_session.cpp
@@ -200,10 +200,10 @@ User* AuthorizationSession::getSingleUser() {
if (userNameItr.more()) {
userName = userNameItr.next();
if (userNameItr.more()) {
- uasserted(ErrorCodes::Unauthorized, "there are no users authenticated");
+ uasserted(ErrorCodes::Unauthorized, "too many users are authenticated");
}
} else {
- uasserted(ErrorCodes::Unauthorized, "too many users are authenticated");
+ uasserted(ErrorCodes::Unauthorized, "there are no users authenticated");
}
return lookupUser(userName);
diff --git a/src/mongo/db/auth/role_graph_builtin_roles.cpp b/src/mongo/db/auth/role_graph_builtin_roles.cpp
index 36cc6b4c15a..0ab6e26d052 100644
--- a/src/mongo/db/auth/role_graph_builtin_roles.cpp
+++ b/src/mongo/db/auth/role_graph_builtin_roles.cpp
@@ -186,6 +186,7 @@ MONGO_INITIALIZER(AuthorizationBuiltinRoles)(InitializerContext* context) {
<< ActionType::getShardMap
<< ActionType::hostInfo
<< ActionType::listDatabases
+ << ActionType::listSessions // clusterManager gets this also
<< ActionType::listShards // clusterManager gets this also
<< ActionType::netstat
<< ActionType::replSetGetConfig // clusterManager gets this also
@@ -238,6 +239,7 @@ MONGO_INITIALIZER(AuthorizationBuiltinRoles)(InitializerContext* context) {
<< ActionType::resync // hostManager gets this also
<< ActionType::addShard
<< ActionType::removeShard
+ << ActionType::listSessions // clusterMonitor gets this also
<< ActionType::listShards // clusterMonitor gets this also
<< ActionType::flushRouterConfig // hostManager gets this also
<< ActionType::cleanupOrphaned;