summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/hashcmd.cpp
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@10gen.com>2012-11-14 19:13:18 -0500
committerSpencer T Brody <spencer@10gen.com>2012-11-28 18:47:17 -0500
commit2c5becd95d63262f55fc1e789615d7636594c983 (patch)
treeb5abcfa6462e886e4b126fce4694fa28725164f1 /src/mongo/db/commands/hashcmd.cpp
parent1ceca5e2c723996de6993ccbdecb3bb526269116 (diff)
downloadmongo-2c5becd95d63262f55fc1e789615d7636594c983.tar.gz
SERVER-7122 Assign required privileges to some more random commands
Diffstat (limited to 'src/mongo/db/commands/hashcmd.cpp')
-rw-r--r--src/mongo/db/commands/hashcmd.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mongo/db/commands/hashcmd.cpp b/src/mongo/db/commands/hashcmd.cpp
index 6e99161ce96..043ab37a77b 100644
--- a/src/mongo/db/commands/hashcmd.cpp
+++ b/src/mongo/db/commands/hashcmd.cpp
@@ -20,9 +20,16 @@
* Defines a shell command for hashing a BSONElement value
*/
+#include <string>
+#include <vector>
+#include "mongo/db/auth/action_set.h"
+#include "mongo/db/auth/action_type.h"
+#include "mongo/db/auth/authorization_manager.h"
+#include "mongo/db/auth/privilege.h"
#include "mongo/db/commands.h"
#include "mongo/db/hasher.h"
+#include "mongo/db/jsobj.h"
namespace mongo {
@@ -31,6 +38,9 @@ namespace mongo {
CmdHashElt() : Command("_hashBSONElement") {};
virtual LockType locktype() const { return NONE; }
virtual bool slaveOk() const { return true; }
+ virtual void addRequiredPrivileges(const std::string& dbname,
+ const BSONObj& cmdObj,
+ std::vector<Privilege>* out) {} // No auth required
virtual void help( stringstream& help ) const {
help << "returns the hash of the first BSONElement val in a BSONObj";
}