How do I reference a database vs a deployment when configuring users in atlas?

I’m using MongoDB Atlas. I have a Project. Inside that Project I have two deployments A and B. Each of those deployments has it’s own databases. Lets say deployment A has databases named foo and bar, and B has databases named foo and baz.

In the Atlas UI I can configure my database users at the deployment level. I want to create 2 users alice and bob. I want to give alice readWrite to database foo on deployment A and bob readWrite to all the collections in all the databases on B.

Some questions:

  1. When I create a database user, is that user added to all the deployments in the project?
  2. How do I set up access control as described above using specific privileges? They only let me specify a database name - how do I refer to a database in a deployment?
1 Like

I have this exact question as well

By default, yes.

Further customization can be achieved using the “Specific Privileges” and “Restrict Access to Specific Clusters/Federated Database Instances/Stream Processing Instances” in the Add Database User screen and are also available when editing a Database User.

1 Like