summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands.h
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@10gen.com>2012-11-06 18:40:38 -0500
committerSpencer T Brody <spencer@10gen.com>2012-11-07 17:04:39 -0500
commitea421b12958bfa1001ae1c66eef6a6af639d7140 (patch)
tree78877caa755fe14a0ead32f386fdaf680a0493bd /src/mongo/db/commands.h
parent288ef9cb3b6ae41afc97ba74e4cf6d15e7a1c194 (diff)
downloadmongo-ea421b12958bfa1001ae1c66eef6a6af639d7140.tar.gz
Add method on Command to get the Privileges required to run that command. SERVER-7572 SERVER-7122
Diffstat (limited to 'src/mongo/db/commands.h')
-rw-r--r--src/mongo/db/commands.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mongo/db/commands.h b/src/mongo/db/commands.h
index d03b792cedf..2d1a8a454ed 100644
--- a/src/mongo/db/commands.h
+++ b/src/mongo/db/commands.h
@@ -17,8 +17,11 @@
#pragma once
-#include "jsobj.h"
-#include "../util/mongoutils/str.h"
+#include <vector>
+
+#include "mongo/db/auth/privilege.h"
+#include "mongo/db/jsobj.h"
+#include "mongo/util/mongoutils/str.h"
namespace mongo {
@@ -106,6 +109,14 @@ namespace mongo {
*/
virtual bool requiresAuth() { return true; }
+ /**
+ * Appends to "*out" the privileges required to run this command on database "dbname" with
+ * the invocation described by "cmdObj".
+ */
+ virtual void addRequiredPrivileges(const std::string& dbname,
+ const BSONObj& cmdObj,
+ std::vector<Privilege>* out);
+
/* Return true if a replica set secondary should go into "recovering"
(unreadable) state while running this command.
*/