MongoError: user is not allowed to do action [listCollections] on [db.]
NodeJS mongodb driver (with or without mongoose) needs to "listCollections" before "createCollection"
But "listCollections" and "createCollection" are in different "rights list" for custom role (look screenshots)
In this case "createCollection" in "Collection Actions" has no sense without "listCollections" from another rights scope "Database Actions and Roles" and user with "createCollection" ability in fact cannot create collection
It can be fixed with moving "createCollection" and "listCollections" rights into one scope
-
Hey Oleksii,
Thank you for the feedback! I hear you that the way we've structured the groupings for various actions isn't intuitive in this case. I hope that in this case, you were able to leverage the search at the top of the dropdown to quickly find the action you wanted. For what it's worth, the groupings you see for Custom Roles is mapped to how one would define privileged actions under the hood: https://docs.mongodb.com/manual/reference/privilege-actions/#listCollections - if you're ever in a similar situation in the future, hopefully this can serve as helpful reference.