diff options
Diffstat (limited to 'src/mongo/db/commands/kill_all_sessions_command.cpp')
-rw-r--r-- | src/mongo/db/commands/kill_all_sessions_command.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mongo/db/commands/kill_all_sessions_command.cpp b/src/mongo/db/commands/kill_all_sessions_command.cpp index ba200c4e443..aeeffacc732 100644 --- a/src/mongo/db/commands/kill_all_sessions_command.cpp +++ b/src/mongo/db/commands/kill_all_sessions_command.cpp @@ -72,11 +72,18 @@ public: Status checkAuthForOperation(OperationContext* opCtx, const std::string& dbname, const BSONObj& cmdObj) override { + + if (serverGlobalParams.featureCompatibility.version.load() == + ServerGlobalParams::FeatureCompatibility::Version::k34) { + return SessionsCommandFCV34Status(getName()); + } + AuthorizationSession* authSession = AuthorizationSession::get(opCtx->getClient()); if (!authSession->isAuthorizedForPrivilege( Privilege{ResourcePattern::forClusterResource(), ActionType::killAnySession})) { return Status(ErrorCodes::Unauthorized, "Unauthorized"); } + return Status::OK(); } @@ -84,6 +91,12 @@ public: const std::string& db, const BSONObj& cmdObj, BSONObjBuilder& result) override { + + if (serverGlobalParams.featureCompatibility.version.load() == + ServerGlobalParams::FeatureCompatibility::Version::k34) { + return appendCommandStatus(result, SessionsCommandFCV34Status(getName())); + } + IDLParserErrorContext ctx("KillAllSessionsCmd"); auto ksc = KillAllSessionsCmd::parse(ctx, cmdObj); |