summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth
diff options
context:
space:
mode:
authorSamy Lanka <samy.lanka@mongodb.com>2021-02-04 00:00:20 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-02-09 23:28:18 +0000
commit4288b338e8c918bc4d109a4e05a6e0fee1920417 (patch)
treec19b1a991f1332e387273c88ccf58cc92d63479d /src/mongo/db/auth
parentfcb69334e15e32049a45ebdcc7d2988acf441f5e (diff)
downloadmongo-4288b338e8c918bc4d109a4e05a6e0fee1920417.tar.gz
SERVER-52553 Convert listCollections command implementation to inherit from IDL-generated base class
Diffstat (limited to 'src/mongo/db/auth')
-rw-r--r--src/mongo/db/auth/authorization_session_impl.cpp4
1 files changed, 3 insertions, 1 deletions
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<PrivilegeVector> 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) {