From 4288b338e8c918bc4d109a4e05a6e0fee1920417 Mon Sep 17 00:00:00 2001 From: Samy Lanka Date: Thu, 4 Feb 2021 00:00:20 +0000 Subject: SERVER-52553 Convert listCollections command implementation to inherit from IDL-generated base class --- src/mongo/db/auth/authorization_session_impl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mongo/db/auth/authorization_session_impl.cpp') diff --git a/src/mongo/db/auth/authorization_session_impl.cpp b/src/mongo/db/auth/authorization_session_impl.cpp index 20ed5d956a6..13175b74549 100644 --- a/src/mongo/db/auth/authorization_session_impl.cpp +++ b/src/mongo/db/auth/authorization_session_impl.cpp @@ -417,7 +417,9 @@ StatusWith AuthorizationSessionImpl::checkAuthorizedToListColle if (AuthorizationSessionImpl::isAuthorizedForPrivileges(privileges)) { return privileges; } - return Status(ErrorCodes::Unauthorized, "unauthorized"); + + return Status(ErrorCodes::Unauthorized, + str::stream() << "Not authorized to list collections on db: " << dbname); } bool AuthorizationSessionImpl::isAuthenticatedAsUserWithRole(const RoleName& roleName) { -- cgit v1.2.1