> This page location: /docs.md > /docs/tools-and-connectors.md > /docs/mongosync.md > /docs/mongosync/current/reference.md

> For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

# User Permissions

The user specified in the `mongosync` connection string must have the required permissions on the source and destination clusters. The permissions vary depending on your environment and if you want to use reverse sync.

## Self-Managed Clusters

The self-managed permissions are:

| Sync Type | Required Source Permissions | Required Destination Permissions |
| --- | --- | --- |
| Default | [`backup`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-backup); [`clusterManager`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-clusterManager); [`clusterMonitor`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-clusterMonitor); [`readWriteAnyDatabase`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-readWriteAnyDatabase); [`restore`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-restore) | [`backup`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-backup); [`clusterManager`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-clusterManager); [`clusterMonitor`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-clusterMonitor); [`readWriteAnyDatabase`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-readWriteAnyDatabase); [`restore`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-restore) |
| Reversing | [`backup`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-backup); [`clusterManager`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-clusterManager); [`clusterMonitor`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-clusterMonitor); [`readWriteAnyDatabase`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-readWriteAnyDatabase); [`restore`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-restore) | [`backup`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-backup); [`clusterManager`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-clusterManager); [`clusterMonitor`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-clusterMonitor); [`dbAdminAnyDatabase`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-dbAdminAnyDatabase); [`readWriteAnyDatabase`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-readWriteAnyDatabase); [`restore`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-restore) |
| Multiple Reversals | [`backup`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-backup); [`clusterManager`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-clusterManager); [`clusterMonitor`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-clusterMonitor); [`dbAdminAnyDatabase`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-dbAdminAnyDatabase); [`readWriteAnyDatabase`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-readWriteAnyDatabase); [`restore`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-restore) | [`backup`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-backup); [`clusterManager`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-clusterManager); [`clusterMonitor`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-clusterMonitor); [`dbAdminAnyDatabase`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-dbAdminAnyDatabase); [`readWriteAnyDatabase`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-readWriteAnyDatabase); [`restore`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-restore) |

For details on server roles, see: [Role-Based Access Control in Self-Managed Deployments.](https://www.mongodb.com/docs/manual/core/authorization.md#std-label-authorization)

To update user permissions, see: [`grantRolesToUser`.](https://www.mongodb.com/docs/manual/reference/command/grantRolesToUser.md#mongodb-dbcommand-dbcmd.grantRolesToUser)

In addition to the roles in the table, provision the following source privileges using a custom role:

```javascript
{
   "resource": { "db": "local", "collection": "oplog.rs" },
   "actions": [ "find", "collStats" ]
}
```

## Atlas Clusters

The Atlas permissions are:

| Sync Type | Required Source Permissions | Required Destination Permissions |
| --- | --- | --- |
| Default | atlasAdmin | atlasAdmin; [`bypassWriteBlockingMode`](https://www.mongodb.com/docs/manual/reference/privilege-actions.md#mongodb-authaction-bypassWriteBlockingMode) |
| Reversing or multiple reversals | atlasAdmin; [`bypassWriteBlockingMode`](https://www.mongodb.com/docs/manual/reference/privilege-actions.md#mongodb-authaction-bypassWriteBlockingMode) | atlasAdmin; [`bypassWriteBlockingMode`](https://www.mongodb.com/docs/manual/reference/privilege-actions.md#mongodb-authaction-bypassWriteBlockingMode) |

For details on Atlas roles, see [Atlas User Roles.](https://www.mongodb.com/docs/atlas/reference/user-roles.md#std-label-user-roles)

To update Atlas user permissions, see: [Manage Access to a Project.](https://www.mongodb.com/docs/atlas/access/manage-project-access/)

## Minimum Privileges

**Note:**

Minimum privileges may change across Mongosync versions.

Minimum privileges only apply to **on-prem deployments** because some privileged actions cannot be created in Atlas using custom roles.

The minimum source privileges are:

| Sync Type | Minimum Source Privileges |
| --- | --- |
| Default | `[
   {
       "resource": { "cluster": true },
       "actions": [
          "appendOplogNote",
          "bypassWriteBlockingMode",
          "getDefaultRWConcern",
          "getShardMap",
          "hostInfo",
          "listDatabases",
          "listShards",
          "replSetGetConfig",
          "replSetGetStatus",
          "serverStatus",
          "setUserWriteBlockMode"
       ]
   },
   {
       "resource": { "db": "", "collection": "" },
       "actions": [
          "changeStream",
          "collStats",
          "find",
          "indexStats",
          "listCollections",
          "listIndexes"
     ]
   },
   {
       "resource": { "db": "local", "collection": "oplog.rs" },
       "actions": [ "find", "collStats" ]
   },
   {
       "resource": { "db": "admin", "collection": "system.version" },
       "actions": [ "find", "collStats" ]
   },
   {
       "resource": { "db": "", "collection": "system.js" },
       "actions": [ "listCollections", "listIndexes" ]
   },
   {
       "resource": { "db": "config", "collection": "shards" },
       "actions": [ "find" ]
   },
   {
       "resource": { "db": "config", "collection": "collections" },
       "actions": [ "find" ]
   },
   {
       "resource": { "db": "config", "collection": "version" },
       "actions": [ "find" ]
   },
   {
       "resource": { "db": "config", "collection": "settings" },
       "actions": [ "find", "update" ]
   },
   {
       "resource": { "system_buckets": "" },
       "actions": [ "listCollections", "listIndexes" ]
   }
]
` |
| Reversing | Everything from the default source privileges and the default destination privileges. |
| Multiple Reversals | Everything from the default source privileges and the default destination privileges with the addition of: `[
    { "resource": { "db": "", "collection": "" }, "actions": [ "dropDatabase" ] }
]
` |
| V5.0 Migration | `[
   {
      "resource": { "cluster": true },
      "actions": [
         "appendOplogNote",
         "getDefaultRWConcern",
         "getShardMap",
         "hostInfo",
         "listDatabases",
         "listShards",
         "replSetGetConfig",
         "replSetGetStatus",
         "serverStatus"
     ]
   },
   {
      "resource": { "db": "", "collection": "" },
      "actions": [
         "changeStream",
         "collStats",
         "find",
         "indexStats",
         "listCollections",
         "listIndexes"
     ]
   },
   {
      "resource": { "db": "admin", "collection": "system.version" },
      "actions": [ "find" ]
   },
   {
      "resource": { "db": "", "collection": "system.js" },
      "actions": [ "listCollections", "listIndexes" ]
   },
   {
      "resource": { "db": "config", "collection": "shards" },
      "actions": [ "find" ]
   },
   {
      "resource": { "db": "config", "collection": "collections" },
      "actions": [ "find" ]
   },
   {
      "resource": { "db": "config", "collection": "version" },
      "actions": [ "find" ]
   },
   {
      "resource": { "db": "config", "collection": "settings" },
      "actions": [ "find", "update" ]
   }
]
` |

The minimum destination privileges are:

| Sync Type | Minimum Destination Privileges |
| --- | --- |
| Default | `[
   {
      "resource": { "cluster": true },
      "actions": [
         "appendOplogNote",
         "getDefaultRWConcern",
         "getShardMap",
         "hostInfo",
         "listDatabases",
         "listShards",
         "replSetGetConfig",
         "replSetGetStatus",
         "serverStatus"
     ]
   },
   {
      "resource": { "db": "", "collection": "" },
      "actions": [
         "bypassDocumentValidation",
         "changeStream",
         "collMod",
         "convertToCapped",
         "createCollection",
         "createIndex",
         "dropCollection",
         "dropIndex",
         "enableSharding",
         "find",
         "indexStats",
         "insert",
         "listCollections",
         "listIndexes",
         "remove",
         "renameCollectionSameDB",
         "update",
         "bypassWriteBlockingMode",
         "setUserWriteBlockMode"
     ]
   },
   {
      "resource": { "db": "admin", "collection": "system.version" },
      "actions": [ "find", "collStats" ]
   },
   {
      "resource": { "db": "", "collection": "system.js" },
      "actions": [ "listCollections", "listIndexes" ]
   },
   {
      "resource": { "db": "", "collection": "system.views" },
      "actions": [ "dropCollection" ]
   },
   {
      "resource": { "db": "config", "collection": "version" },
      "actions": [ "find" ]
   },
   {
      "resource": { "db": "config", "collection": "collections" },
      "actions": [ "find" ]
   },
   {
      "resource": { "db": "config", "collection": "settings" },
      "actions": [ "find", "update" ]
   },
   {
      "resource": { "db": "config", "collection": "shards" },
      "actions": [ "find", "update" ]
   },
   {
      "resource": { "db": "config", "collection": "tags" },
      "actions": [ "find", "update", "remove" ]
   },
   {
      "resource": { "system_buckets": "" },
      "actions": [ "listCollections", "listIndexes" ]
   }
]
` |
| Reversing | Everything from the default source privileges and the default destination privileges with the addition of: `[
   { "resource": { "db": "", "collection": "" }, "actions": [ "dropDatabase" ] }
]
` |
| Multiple Reversals | Everything from the default source privileges and the default destination privileges with the addition of: `[
   { "resource": { "db": "", "collection": "" }, "actions": [ "dropDatabase" ] }
]
` |

## Pre-6.0 Migrations

When migrating from a 5.0 source cluster, the source cluster should either have [`clusterManager`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-clusterManager) or the minimum permissions listed for v5.0.

The minimum source permissions for v5.0 are:

| Sync Type | Minimum Source Privileges |
| --- | --- |
| V5.0 Migration | `[
   {
      "resource": { "cluster": true },
      "actions": [
         "appendOplogNote",
         "getDefaultRWConcern",
         "getShardMap",
         "hostInfo",
         "listDatabases",
         "listShards",
         "replSetGetConfig",
         "replSetGetStatus",
         "serverStatus"
     ]
   },
   {
      "resource": { "db": "", "collection": "" },
      "actions": [
         "changeStream",
         "collStats",
         "find",
         "indexStats",
         "listCollections",
         "listIndexes"
     ]
   },
   {
      "resource": { "db": "admin", "collection": "system.version" },
      "actions": [ "find" ]
   },
   {
      "resource": { "db": "", "collection": "system.js" },
      "actions": [ "listCollections", "listIndexes" ]
   },
   {
      "resource": { "db": "config", "collection": "shards" },
      "actions": [ "find" ]
   },
   {
      "resource": { "db": "config", "collection": "collections" },
      "actions": [ "find" ]
   },
   {
      "resource": { "db": "config", "collection": "version" },
      "actions": [ "find" ]
   },
   {
      "resource": { "db": "config", "collection": "settings" },
      "actions": [ "find", "update" ]
   }
]
` |
