We are using the Atlas API to create users with custom roles.
We use the custom roles to restrict users to reading/writing specific collections within a database.
We do not allow the users to access all collections within the database and we do not allow them to access any other databases.
We want to give our users the ability to list the collections in a specific database.
Is there a way to use the API to grant the listCollections permission?
We are using the Atlas API to create users with custom roles.
We want to give our users the ability to list the collections in a specific database.
Is there a way to use the API to grant the listCollections permission?
It sounds like you have already created the custom roles and users via the API. If you wish to update custom roles via the Atlas API to grant the listCollections permission, the Update a Custom Role documentation may help.
As an example, I have an existing custom role named customRole2 with read access to the database named searchdb:
If there are any concerns, you can always test this against a test custom role or database user initially to see if the API request gets you the desired result.
Please share how to create customRole in MongoDB Atlas? I’m having issue facing this
{"detail":"Received JSON is malformed.","error":400,"errorCode":"MALFORMED_JSON","parameters":[],"reason":"Bad Request"}* Connection #0 to host cloud.mongodb.com left intact