summaryrefslogtreecommitdiff
path: root/src/mongo/db/matcher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/matcher.cpp')
-rw-r--r--src/mongo/db/matcher.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/db/matcher.cpp b/src/mongo/db/matcher.cpp
index 2e679591f2c..386415a81c6 100644
--- a/src/mongo/db/matcher.cpp
+++ b/src/mongo/db/matcher.cpp
@@ -27,6 +27,7 @@
#include "db.h"
#include "queryutil.h"
#include "client.h"
+#include "mongo/db/auth/authorization_manager.h"
#include "pdfile.h"
@@ -74,8 +75,10 @@ namespace mongo {
return;
_initCalled = true;
+ const string userToken = ClientBasic::getCurrent()->getAuthorizationManager()
+ ->getAuthenticatedPrincipalNamesToken();
NamespaceString ns( _ns );
- _scope = globalScriptEngine->getPooledScope( ns.db.c_str(), "where" );
+ _scope = globalScriptEngine->getPooledScope( ns.db.c_str(), "where" + userToken );
massert( 10341 , "code has to be set first!" , ! _jsCode.empty() );