From f8e07b96bb0fa4a90d0e49a2e79ca443c849ba44 Mon Sep 17 00:00:00 2001 From: jeff-allen-mongo Date: Thu, 24 May 2018 12:25:05 -0400 Subject: [PATCH] DOCS-11103 - Updates to listDatabases command --- source/reference/command/listDatabases.txt | 20 +++++++++++++++++++- source/release-notes/4.0-compatibility.txt | 10 +++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/source/reference/command/listDatabases.txt b/source/reference/command/listDatabases.txt index 4df77bc625a..7bad94df7be 100644 --- a/source/reference/command/listDatabases.txt +++ b/source/reference/command/listDatabases.txt @@ -32,7 +32,6 @@ Definition .. include:: /includes/apiargs/dbcommand-listDatabases-field.rst - Output ------ @@ -54,6 +53,25 @@ Output - A field named ``totalSize`` whose value is the sum of all the ``sizeOnDisk`` fields in bytes. +Behavior +-------- + +.. versionchanged:: 4.0 + + When :doc:`authentication ` is enabled, the + :dbcommand:`listDatabases` command returns different values based on + the :doc:`privilege actions ` + assigned to the user who executes the command. + + - If the user has the :authaction:`listDatabases` privilege action, + the :dbcommand:`listDatabases` command returns a list of all + existing databases. + + - If the user does not have the :authaction:`listDatabases` + privilege action, the :dbcommand:`listDatabases` command only + returns a list of databases for which the user has the + :authaction:`find` action privilege. + Examples -------- diff --git a/source/release-notes/4.0-compatibility.txt b/source/release-notes/4.0-compatibility.txt index c6a1e65b74a..a9fc51c9850 100644 --- a/source/release-notes/4.0-compatibility.txt +++ b/source/release-notes/4.0-compatibility.txt @@ -138,6 +138,14 @@ General - MongoDB removes the obsolete ``logUserIds`` parameter. Use :doc:`/core/auditing` instead. +- When :doc:`authentication ` is enabled, running + the :dbcommand:`listDatabases` command without the + :authaction:`listDatabases` action privilege returns a list of all + databases on which the user running the command has the + :authaction:`find` action privilege. In previous versions, running + the command without the :authaction:`listDatabases` action resulted + in an ``Unauthorized`` response. + Removed Binary and Deprecated Fields/Commands --------------------------------------------- @@ -201,6 +209,6 @@ Output Field Changes - The :pipeline:`$currentOp` aggregation stage, the :dbcommand:`currentOp` command, and :method:`db.currentOp()` helper no longer return the ``threadId`` field in their outputs. - + - The :dbcommand:`serverStatus` command now always returns ``0`` for the :serverstatus:`asserts.warning` field.