summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth/authorization_session.cpp
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2015-06-22 12:25:10 -0400
committerDavid Storch <david.storch@10gen.com>2015-06-23 14:16:18 -0400
commitb8f0f273d8f2db1aed1974b94c9b18a63656ad48 (patch)
treeef86771a005eed7dc7d409857f187aba764a0a02 /src/mongo/db/auth/authorization_session.cpp
parentedfeb6a9f7a5f30a951c673374e9e058b1886a10 (diff)
downloadmongo-b8f0f273d8f2db1aed1974b94c9b18a63656ad48.tar.gz
SERVER-5811 implement the killCursors command for mongod
Implementing the killCursors command in mongos and the mongo shell is further work.
Diffstat (limited to 'src/mongo/db/auth/authorization_session.cpp')
-rw-r--r--src/mongo/db/auth/authorization_session.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/db/auth/authorization_session.cpp b/src/mongo/db/auth/authorization_session.cpp
index 22bd1b1f191..a193655b242 100644
--- a/src/mongo/db/auth/authorization_session.cpp
+++ b/src/mongo/db/auth/authorization_session.cpp
@@ -192,7 +192,7 @@ Status AuthorizationSession::checkAuthForQuery(const NamespaceString& ns, const
Status AuthorizationSession::checkAuthForGetMore(const NamespaceString& ns, long long cursorID) {
// "ns" can be in one of three formats: "listCollections" format, "listIndexes" format, and
// normal format.
- if (ns.isListCollectionsGetMore()) {
+ if (ns.isListCollectionsCursorNS()) {
// "ns" is of the form "<db>.$cmd.listCollections". Check if we can perform the
// listCollections action on the database resource for "<db>".
if (!isAuthorizedForActionsOnResource(ResourcePattern::forDatabaseName(ns.db()),
@@ -201,10 +201,10 @@ Status AuthorizationSession::checkAuthForGetMore(const NamespaceString& ns, long
str::stream() << "not authorized for listCollections getMore on "
<< ns.ns());
}
- } else if (ns.isListIndexesGetMore()) {
+ } else if (ns.isListIndexesCursorNS()) {
// "ns" is of the form "<db>.$cmd.listIndexes.<coll>". Check if we can perform the
// listIndexes action on the "<db>.<coll>" namespace.
- NamespaceString targetNS = ns.getTargetNSForListIndexesGetMore();
+ NamespaceString targetNS = ns.getTargetNSForListIndexes();
if (!isAuthorizedForActionsOnNamespace(targetNS, ActionType::listIndexes)) {
return Status(ErrorCodes::Unauthorized,
str::stream() << "not authorized for listIndexes getMore on " << ns.ns());
@@ -275,15 +275,15 @@ Status AuthorizationSession::checkAuthForDelete(const NamespaceString& ns, const
Status AuthorizationSession::checkAuthForKillCursors(const NamespaceString& ns,
long long cursorID) {
// See implementation comments in checkAuthForGetMore(). This method looks very similar.
- if (ns.isListCollectionsGetMore()) {
+ if (ns.isListCollectionsCursorNS()) {
if (!isAuthorizedForActionsOnResource(ResourcePattern::forDatabaseName(ns.db()),
ActionType::killCursors)) {
return Status(ErrorCodes::Unauthorized,
str::stream() << "not authorized to kill listCollections cursor on "
<< ns.ns());
}
- } else if (ns.isListIndexesGetMore()) {
- NamespaceString targetNS = ns.getTargetNSForListIndexesGetMore();
+ } else if (ns.isListIndexesCursorNS()) {
+ NamespaceString targetNS = ns.getTargetNSForListIndexes();
if (!isAuthorizedForActionsOnNamespace(targetNS, ActionType::killCursors)) {
return Status(ErrorCodes::Unauthorized,
str::stream() << "not authorized to kill listIndexes cursor on "