summaryrefslogtreecommitdiff
path: root/src/mongo/s/commands/cluster_control_balancer_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/commands/cluster_control_balancer_cmd.cpp')
-rw-r--r--src/mongo/s/commands/cluster_control_balancer_cmd.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mongo/s/commands/cluster_control_balancer_cmd.cpp b/src/mongo/s/commands/cluster_control_balancer_cmd.cpp
index 2cf2bfd5eef..97bc5fbcbb8 100644
--- a/src/mongo/s/commands/cluster_control_balancer_cmd.cpp
+++ b/src/mongo/s/commands/cluster_control_balancer_cmd.cpp
@@ -74,12 +74,13 @@ public:
return "Starts or stops the sharding balancer.";
}
- Status checkAuthForCommand(Client* client,
- const std::string& dbname,
- const BSONObj& cmdObj) const override {
- if (!AuthorizationSession::get(client)->isAuthorizedForActionsOnResource(
- ResourcePattern::forExactNamespace(NamespaceString("config", "settings")),
- _authorizationAction)) {
+ Status checkAuthForOperation(OperationContext* opCtx,
+ const DatabaseName&,
+ const BSONObj&) const override {
+ if (!AuthorizationSession::get(opCtx->getClient())
+ ->isAuthorizedForActionsOnResource(
+ ResourcePattern::forExactNamespace(NamespaceString("config", "settings")),
+ _authorizationAction)) {
return Status(ErrorCodes::Unauthorized, "Unauthorized");
}
return Status::OK();