summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands.cpp
diff options
context:
space:
mode:
authormatt dannenberg <matt.dannenberg@10gen.com>2015-04-09 10:01:45 -0400
committermatt dannenberg <matt.dannenberg@10gen.com>2015-04-17 11:27:21 -0400
commit5a29fa08eeea0ece229102dcd4e7b6580c7acd1d (patch)
tree15d965b370cee5c9bca32f91c3d944ccc04d7038 /src/mongo/db/commands.cpp
parentea32e99a4e06930b2cae7b03882e3fda3333934b (diff)
downloadmongo-5a29fa08eeea0ece229102dcd4e7b6580c7acd1d.tar.gz
SERVER-15860 Switch replication metadata ops to be replication-specific, rather than using commands
Diffstat (limited to 'src/mongo/db/commands.cpp')
-rw-r--r--src/mongo/db/commands.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/mongo/db/commands.cpp b/src/mongo/db/commands.cpp
index f81caefe991..0db0b13e739 100644
--- a/src/mongo/db/commands.cpp
+++ b/src/mongo/db/commands.cpp
@@ -364,10 +364,9 @@ namespace mongo {
static Status _checkAuthorizationImpl(Command* c,
ClientBasic* client,
const std::string& dbname,
- const BSONObj& cmdObj,
- bool fromRepl) {
+ const BSONObj& cmdObj) {
namespace mmb = mutablebson;
- if ( c->adminOnly() && ! fromRepl && dbname != "admin" ) {
+ if ( c->adminOnly() && dbname != "admin" ) {
return Status(ErrorCodes::Unauthorized, str::stream() << c->name <<
" may only be run against the admin database.");
}
@@ -397,10 +396,9 @@ namespace mongo {
Status Command::_checkAuthorization(Command* c,
ClientBasic* client,
const std::string& dbname,
- const BSONObj& cmdObj,
- bool fromRepl) {
+ const BSONObj& cmdObj) {
namespace mmb = mutablebson;
- Status status = _checkAuthorizationImpl(c, client, dbname, cmdObj, fromRepl);
+ Status status = _checkAuthorizationImpl(c, client, dbname, cmdObj);
if (!status.isOK()) {
log(LogComponent::kAccessControl) << status << std::endl;
}
@@ -434,7 +432,12 @@ namespace mongo {
out->push_back(Privilege(ResourcePattern::forClusterResource(), actions));
}
- virtual bool run(OperationContext* txn, const string&, mongo::BSONObj&, int, std::string&, mongo::BSONObjBuilder& result, bool) {
+ virtual bool run(OperationContext* txn,
+ const string&,
+ mongo::BSONObj&,
+ int,
+ std::string&,
+ mongo::BSONObjBuilder& result) {
shardConnectionPool.flush();
pool.flush();
return true;
@@ -457,7 +460,12 @@ namespace mongo {
actions.addAction(ActionType::connPoolStats);
out->push_back(Privilege(ResourcePattern::forClusterResource(), actions));
}
- virtual bool run(OperationContext* txn, const string&, mongo::BSONObj&, int, std::string&, mongo::BSONObjBuilder& result, bool) {
+ virtual bool run(OperationContext* txn,
+ const string&,
+ mongo::BSONObj&,
+ int,
+ std::string&,
+ mongo::BSONObjBuilder& result) {
pool.appendInfo( result );
result.append( "numDBClientConnection" , DBClientConnection::getNumConnections() );
result.append( "numAScopedConnection" , AScopedConnection::getNumConnections() );