diff options
author | Spencer T Brody <spencer@10gen.com> | 2012-11-14 19:13:18 -0500 |
---|---|---|
committer | Spencer T Brody <spencer@10gen.com> | 2012-11-28 18:47:17 -0500 |
commit | 2c5becd95d63262f55fc1e789615d7636594c983 (patch) | |
tree | b5abcfa6462e886e4b126fce4694fa28725164f1 /src/mongo/db/commands/fsync.cpp | |
parent | 1ceca5e2c723996de6993ccbdecb3bb526269116 (diff) | |
download | mongo-2c5becd95d63262f55fc1e789615d7636594c983.tar.gz |
SERVER-7122 Assign required privileges to some more random commands
Diffstat (limited to 'src/mongo/db/commands/fsync.cpp')
-rw-r--r-- | src/mongo/db/commands/fsync.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mongo/db/commands/fsync.cpp b/src/mongo/db/commands/fsync.cpp index 5cf61547bab..e822374ed48 100644 --- a/src/mongo/db/commands/fsync.cpp +++ b/src/mongo/db/commands/fsync.cpp @@ -20,10 +20,18 @@ #include "mongo/db/commands/fsync.h" +#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/d_concurrency.h" #include "mongo/db/commands.h" #include "mongo/db/dur.h" #include "mongo/db/client.h" +#include "mongo/db/jsobj.h" #include "mongo/util/background.h" namespace mongo { @@ -65,6 +73,13 @@ namespace mongo { virtual bool slaveOk() const { return true; } virtual bool adminOnly() const { return true; } virtual void help(stringstream& h) const { h << url(); } + virtual void addRequiredPrivileges(const std::string& dbname, + const BSONObj& cmdObj, + std::vector<Privilege>* out) { + ActionSet actions; + actions.addAction(ActionType::fsync); + out->push_back(Privilege(AuthorizationManager::SERVER_RESOURCE_NAME, actions)); + } virtual bool run(const string& dbname, BSONObj& cmdObj, int, string& errmsg, BSONObjBuilder& result, bool fromRepl) { if (Lock::isLocked()) { |