fix(data-service): use databases where user has built in roles in listDatabases
COMPASS-5691
#2959
+184
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
COMPASS-5691 https://github.com/mongodb-js/compass/issues/2953
Description
Atlas shared tier clusters (serverless, M0, M2) with MongoDB server version 5+ do not currently return privileges with the
connectionStatus
command response (fix might be in soon/already w/ CLOUDP-115805). It also fails tolistDatabases
. As a result, currently a user with permissions to only one database would not be able to see their database.While there may be a release of Atlas soon making this issue go away, the changes in this PR introduce a workaround so users with exclusive database permissions can use their databases. These changes expand our extra
listDatabases
affordances by referencing the authenticatedUserRoles in theconnectionStatus
response. We then add all of the databases where a user has any of theread
,readWrite
,dbAdmin
,dbOwner
built-in roles.Motivation and Context
Open Questions
Is there another way to get this information? Is there anything we can do for cases where users are using custom roles with custom privileges for their access management?
Types of changes