summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth/authorization_session_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/auth/authorization_session_impl.cpp')
-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) {