[Yandex Cloud documentation](../../index.md) > [Yandex StoreDoc](../index.md) > Access management

# Access management in Yandex StoreDoc


In this section, you will learn about:

* [Resources available for role assignment](#resources).
* [Available service roles](#roles-list).
* [Roles required for specific actions](#required-roles).

## Access management {#about-access-control}

[Yandex Identity and Access Management](../../iam/index.md) checks all operations in Yandex Cloud. If an entity does not have required permissions, IAM returns an error.


To grant permissions for a resource, [assign](../../iam/operations/roles/grant.md) the relevant resource roles to an entity performing operations. You can assign roles to a [Yandex account](../../iam/concepts/users/accounts.md#passport), [service account](../../iam/concepts/users/service-accounts.md), [local user](../../iam/concepts/users/accounts.md#local), [federated user](../../iam/concepts/federations.md), [user group](../../organization/operations/manage-groups.md), [system group](../../iam/concepts/access-control/system-group.md), or [public group](../../iam/concepts/access-control/public-group.md). For more information, see [How access management works in Yandex Cloud](../../iam/concepts/access-control/index.md).

To assign roles for resources, you need either the `mdb.admin` role, the `managed-mongodb.admin` role, or one of the following roles on that resource:

* `admin`
* `resource-manager.admin`
* `organization-manager.admin`
* `resource-manager.clouds.owner`
* `organization-manager.organizations.owner`

## Resources available for role assignment {#resources}

You can assign a role to an [organization](../../organization/concepts/organization.md), [cloud](../../resource-manager/concepts/resources-hierarchy.md#cloud), or [folder](../../resource-manager/concepts/resources-hierarchy.md#folder). The roles assigned to organizations, clouds, and folders also apply to their nested resources.

To allow access to service resources (DB clusters and hosts, cluster backups, databases and their users), assign the user the appropriate roles for the folder, cloud, or organization containing these resources.

You can also assign a role for an individual cluster in the [management console](https://console.yandex.cloud), via the [CLI](../../cli/index.md), or [API](../api-ref/authentication.md).

## Available service roles {#roles-list}

The diagram below shows available service roles and their permission inheritance hierarchy. For example, `editor` inherits all `viewer` permissions. You can find role descriptions below the diagram.

```mermaid
%%{
  init: {
    "flowchart": { "defaultRenderer": "elk" },
    "elk": { "nodePlacementStrategy": "NETWORK_SIMPLEX" }
  }
}%%
flowchart BT
    vpc.publicAdmin
    managed-mongodb.clusters.connector["`managed-mongodb.
    clusters.connector`"]
    managed-mongodb.viewer --> managed-mongodb.switcher
    managed-mongodb.maintenanceTask.viewer --> managed-mongodb.viewer
    managed-mongodb.switcher --> managed-mongodb.editor
    managed-mongodb.auditor --> managed-mongodb.viewer --> managed-mongodb.restorer
    managed-mongodb.restorer --> managed-mongodb.editor
    managed-mongodb.viewer --> managed-mongodb.editor
    managed-mongodb.maintenanceTask.editor --> managed-mongodb.editor
    managed-mongodb.auditor --> managed-mongodb.maintenanceTask.viewer["`managed-mongodb.
    maintenanceTask.viewer`"]
    managed-mongodb.editor --> managed-mongodb.admin
    managed-mongodb.maintenanceTask.viewer --> managed-mongodb.maintenanceTask.editor["`managed-mongodb.
    maintenanceTask.editor`"]
    managed-mongodb.auditor --> mdb.auditor --> mdb.viewer --> mdb.admin
    managed-mongodb.viewer --> mdb.viewer --> mdb.restorer
    mdb.auditor --> mdb.maintenanceTask.viewer
    mdb.maintenanceTask.viewer --> mdb.maintenanceTask.editor
    managed-mongodb.maintenanceTask.viewer --> mdb.maintenanceTask.viewer
    managed-mongodb.maintenanceTask.editor --> mdb.maintenanceTask.editor
    managed-mongodb.admin --> mdb.admin
    managed-mongodb.switcher --> mdb.switcher
    managed-mongodb.user --> managed-mongodb.editor
```

### Service roles {#service-roles}

#### managed-mongodb.clusters.connector {#managed-mongodb-clusters-connector}

The `managed-mongodb.clusters.connector ` role enables Yandex Cloud [users](../../iam/concepts/users/accounts.md) to connect to databases in [Yandex StoreDoc clusters](../concepts/index.md) via [Yandex Identity and Access Management](../../iam/index.md).

#### managed-mongodb.auditor {#managed-mongodb-auditor}

The `managed-mongodb.auditor` role enables viewing info on [Yandex StoreDoc clusters](../concepts/index.md) and [access permissions](../../iam/concepts/access-control/index.md) granted for them, on [hosts](../concepts/instance-types.md) and cluster [backups](../concepts/backup.md), and on [quotas](../concepts/limits.md#mmg-quotas) and resource operations.

#### managed-mongodb.viewer {#managed-mongodb-viewer}

The `managed-mongodb.viewer` role enables viewing info on Yandex StoreDoc clusters, hosts, shards, databases, users, cluster logs, quotas, and resource operations.

Users with this role can:
* View info on [Yandex StoreDoc clusters](../concepts/index.md) and [access permissions](../../iam/concepts/access-control/index.md) granted for them.
* View info on [maintenance](../concepts/maintenance.md) tasks for Yandex StoreDoc clusters and modify such tasks.
* View info on Yandex StoreDoc cluster [hosts](../concepts/instance-types.md).
* View info on Yandex StoreDoc cluster [shards](../concepts/sharding.md).
* View info on Yandex StoreDoc databases.
* View info on Yandex StoreDoc [users](../concepts/users-and-roles.md).
* View info on Yandex StoreDoc cluster [backups](../concepts/backup.md).
* View info on Yandex StoreDoc alerts.
* View Yandex StoreDoc cluster [logs](../operations/cluster-logs.md).
* View info on the results of Yandex StoreDoc cluster performance diagnostics.
* View info on Yandex StoreDoc [quotas](../concepts/limits.md#mmg-quotas).
* View info on resource operations for Yandex StoreDoc.

This role includes the `managed-mongodb.auditor` and `managed-mongodb.maintenanceTask.viewer` permissions.

#### managed-mongodb.restorer {#managed-mongodb-restorer}

The `managed-mongodb.restorer` role enables restoring Yandex StoreDoc clusters from backups and viewing info on Yandex StoreDoc clusters, hosts, shards, databases, users, cluster logs, quotas, and resource operations.

Users with this role can:
* View info on [Yandex StoreDoc cluster](../concepts/index.md) backups and restore clusters from [backups](../concepts/backup.md).
* View info on Yandex StoreDoc clusters and [access permissions](../../iam/concepts/access-control/index.md) granted for them.
* View info on [maintenance](../concepts/maintenance.md) tasks for Yandex StoreDoc clusters and modify such tasks.
* View info on Yandex StoreDoc cluster [hosts](../concepts/instance-types.md).
* View info on Yandex StoreDoc cluster [shards](../concepts/sharding.md).
* View info on Yandex StoreDoc databases.
* View info on Yandex StoreDoc [users](../concepts/users-and-roles.md).
* View info on Yandex StoreDoc alerts.
* View Yandex StoreDoc cluster [logs](../operations/cluster-logs.md).
* View info on the results of Yandex StoreDoc cluster performance diagnostics.
* View info on Yandex StoreDoc [quotas](../concepts/limits.md#mmg-quotas).
* View info on resource operations for Yandex StoreDoc.

This role includes the `managed-mongodb.viewer` permissions.

#### managed-mongodb.user {#managed-mongodb-user}

The `managed-mongodb.user` role enables using [Yandex StoreDoc clusters](../concepts/index.md).

#### managed-mongodb.switcher {#managed-mongodb-switcher}

The `managed-mongodb.switcher` role enables re-assigning the master host in Yandex StoreDoc clusters and viewing info on Yandex StoreDoc clusters, hosts, shards, databases, users, cluster logs, quotas, and resource operations.

Users with this role can:
* Re-assign the master host in [Yandex StoreDoc clusters](../concepts/index.md).
* View info on Yandex StoreDoc clusters and [access permissions](../../iam/concepts/access-control/index.md) granted for them.
* View info on [maintenance](../concepts/maintenance.md) tasks for Yandex StoreDoc clusters and modify such tasks.
* View info on Yandex StoreDoc cluster [hosts](../concepts/instance-types.md).
* View info on Yandex StoreDoc cluster [shards](../concepts/sharding.md).
* View info on Yandex StoreDoc databases.
* View info on Yandex StoreDoc [users](../concepts/users-and-roles.md).
* View info on Yandex StoreDoc cluster [backups](../concepts/backup.md).
* View info on Yandex StoreDoc alerts.
* View Yandex StoreDoc cluster [logs](../operations/cluster-logs.md).
* View info on the results of Yandex StoreDoc cluster performance diagnostics.
* View info on Yandex StoreDoc [quotas](../concepts/limits.md#mmg-quotas).
* View info on resource operations for Yandex StoreDoc.

This role includes the `managed-mongodb.viewer` permissions.

#### managed-mongodb.editor {#managed-mongodb-editor}

The `managed-mongodb.editor` role enables managing Yandex StoreDoc clusters.

Users with this role can:
* Create, use, modify, delete, run and stop [Yandex StoreDoc clusters](../concepts/index.md) and view info on them.
* View info on [access permissions](../../iam/concepts/access-control/index.md) granted for Yandex StoreDoc clusters.
* View info on [maintenance](../concepts/maintenance.md) tasks for Yandex StoreDoc clusters and modify such tasks.
* Create, modify, and delete Yandex StoreDoc cluster [hosts](../concepts/instance-types.md) and view info on them.
* Re-assign the master host in Yandex StoreDoc clusters.
* Create and delete Yandex StoreDoc cluster [shards](../concepts/sharding.md) and view info on them.
* Create and delete Yandex StoreDoc databases and view info on them.
* Create, modify, and delete Yandex StoreDoc [users](../concepts/users-and-roles.md) and view info on them.
* Create Yandex StoreDoc cluster [backups](../concepts/backup.md), view info on them, as well as restore clusters from backups.
* Create, modify, and delete Yandex StoreDoc alerts and view info on them.
* View Yandex StoreDoc cluster logs.
* View info on the results of Yandex StoreDoc cluster performance diagnostics.
* View info on Yandex StoreDoc [quotas](../concepts/limits.md#mmg-quotas).
* View info on resource operations for Yandex StoreDoc.

This role includes the `managed-mongodb.viewer`, `managed-mongodb.restorer`, `managed-mongodb.user`, `managed-mongodb.switcher`, and `managed-mongodb.maintenanceTask.editor` permissions.

To create Yandex StoreDoc clusters, you also need the `vpc.user` role.

#### managed-mongodb.admin {#managed-mongodb-admin}

The `managed-mongodb.admin` role enables managing Yandex StoreDoc clusters and access to them.

Users with this role can:
* View info on [access permissions](../../iam/concepts/access-control/index.md) granted for [Yandex StoreDoc clusters](../concepts/index.md) and modify such permissions.
* Create, use, modify, delete, run and stop Yandex StoreDoc clusters and view info on them.
* View info on [maintenance](../concepts/maintenance.md) tasks for Yandex StoreDoc clusters and modify such tasks.
* Create, modify, and delete Yandex StoreDoc cluster [hosts](../concepts/instance-types.md) and view info on them.
* Re-assign the master host in Yandex StoreDoc clusters.
* Create and delete Yandex StoreDoc cluster [shards](../concepts/sharding.md) and view info on them.
* Create and delete Yandex StoreDoc databases and view info on them.
* Create, modify, and delete Yandex StoreDoc [users](../concepts/users-and-roles.md) and view info on them.
* Create Yandex StoreDoc cluster [backups](../concepts/backup.md), view info on them, as well as restore clusters from backups.
* Create, modify, and delete Yandex StoreDoc alerts and view info on them.
* View Yandex StoreDoc cluster logs.
* View info on the results of Yandex StoreDoc cluster performance diagnostics.
* View info on Yandex StoreDoc [quotas](../concepts/limits.md#mmg-quotas).
* View info on resource operations for Yandex StoreDoc.

This role includes the `managed-mongodb.editor` permissions.

To create Yandex StoreDoc clusters, you also need the `vpc.user` role.

#### managed-mongodb.maintenanceTask.viewer {#managed-mongodb-maintenanceTask-viewer}

The `managed-mongodb.maintenanceTask.viewer` role enables viewing info on [Yandex StoreDoc clusters](../concepts/index.md), their [maintenance](../concepts/maintenance.md) tasks, and [access permissions](../../iam/concepts/access-control/index.md) granted for them, on [hosts](../concepts/instance-types.md) and cluster [backups](../concepts/backup.md), and on [quotas](../concepts/limits.md#mmg-quotas) and resource operations.

This role includes the `managed-mongodb.auditor` permissions.

#### managed-mongodb.maintenanceTask.editor {#managed-mongodb-maintenanceTask-editor}

The `managed-mongodb.maintenanceTask.editor` role enables viewing info on [maintenance](../concepts/maintenance.md) tasks for Yandex StoreDoc clusters and modifying such tasks, as well as viewing info on [Yandex StoreDoc clusters](../concepts/index.md) and [access permissions](../../iam/concepts/access-control/index.md) granted for them, on [hosts](../concepts/instance-types.md) and cluster [backups](../concepts/backup.md), and on [quotas](../concepts/limits.md#mmg-quotas) and resource operations.

This role includes the `managed-mongodb.maintenanceTask.viewer` permissions.

#### mdb.auditor {#mdb-auditor}

The `mdb.auditor` role grants the minimum permissions required to view info on managed database clusters (without access to data or logs).

Users with this role can view info on managed database clusters, quotas, and resource operations.

This role includes the `managed-opensearch.auditor`, `managed-kafka.auditor`, `managed-mysql.auditor`, `managed-postgresql.auditor`, `managed-spqr.auditor`, `managed-greenplum.auditor`, `managed-clickhouse.auditor`, `managed-redis.auditor`, and `managed-mongodb.auditor` permissions.

#### mdb.viewer {#mdb-viewer}

The `mdb.viewer` role grants read access to managed database clusters and cluster logs.

Users with this role can read from databases, view the logs of managed database clusters, and view info on cluster maintenance tasks, clusters, quotas, and resource operations.

This role includes the `managed-opensearch.viewer`, `managed-kafka.viewer`, `managed-mysql.viewer`, `managed-postgresql.viewer`, `managed-greenplum.viewer`, `managed-clickhouse.viewer`, `managed-redis.viewer`, `managed-mongodb.viewer`, and `dataproc.viewer` permissions.

#### mdb.admin {#mdb-admin}

The `mdb.admin` role grants full access to managed database clusters.

Users with this role can create, edit, delete, run, and stop managed database clusters, manage access to clusters, create cluster backups and restore clusters from backups, read and write to databases, view info on clusters, view and modify cluster maintenance tasks, and view cluster logs as well as info on quotas and resource operations.

This role includes the `mdb.viewer`, `vpc.user`, `managed-opensearch.admin`, `managed-kafka.admin`, `managed-mysql.admin`, `managed-postgresql.admin`, `managed-spqr.admin`, `managed-greenplum.admin`, `managed-clickhouse.admin`, `managed-redis.admin`, `managed-mongodb.admin`, and `dataproc.admin` permissions.

#### mdb.restorer {#mdb-restorer}

The `mdb.restorer` role enables restoring managed database clusters from backups and grants read access to such clusters and their logs.

Users with this role can restore managed database clusters from backups, read from databases, view cluster logs, and view info on clusters, their maintenance tasks, quotas, and resource operations.

This role includes the `mdb.viewer`, `managed-opensearch.restorer`, `managed-mysql.restorer`, `managed-postgresql.restorer`, `managed-spqr.restorer`, `managed-greenplum.restorer`, `managed-clickhouse.restorer`, `managed-redis.restorer`, and `managed-mongodb.restorer` permissions.

#### mdb.switcher {#mdb-switcher}

The `mdb.switcher` role enables re-assigning the master host in managed database clusters and grants access to information on such clusters and their logs.

Users with this role can re-assign the master host in managed database clusters, view info on such clusters, their hosts, databases, and users, as well as view cluster logs, service quotas, and resource operations.

This role includes the `mdb.viewer`, `managed-mongodb.switcher`, `managed-mysql.switcher`, `managed-postgresql.switcher`, and `managed-redis.switcher` permissions.

#### mdb.maintenanceTask.viewer {#mdb-maintenanceTask-viewer}

The `mdb.maintenanceTask.viewer` role grants access to information on maintenance tasks for managed database clusters.

Users with this role can view information on managed database clusters, their maintenance tasks, and access permissions granted for them, on hosts and cluster backups, as well as on service quotas and resource operations.

This role includes the `mdb.auditor`, `managed-clickhouse.maintenanceTask.viewer`, `managed-greenplum.maintenanceTask.viewer`, `managed-kafka.maintenanceTask.viewer`, `managed-mongodb.maintenanceTask.viewer`, `managed-mysql.maintenanceTask.viewer`, `managed-opensearch.maintenanceTask.viewer`, `managed-postgresql.maintenanceTask.viewer`, `managed-redis.maintenanceTask.viewer`, and `managed-spqr.maintenanceTask.viewer` permissions.

#### mdb.maintenanceTask.editor {#mdb-maintenanceTask-editor}

The `mdb.maintenanceTask.editor` role enables managing maintenance tasks for managed database clusters.

Users with this role can view information on maintenance tasks for managed database clusters and modify such tasks, view information on managed database clusters and access permissions granted for them, on cluster hosts and backups, as well as on service quotas and resource operations.

This role includes the `mdb.maintenanceTask.viewer`, `managed-clickhouse.maintenanceTask.editor`, `managed-greenplum.maintenanceTask.editor`, `managed-kafka.maintenanceTask.editor`, `managed-mongodb.maintenanceTask.editor`, `managed-mysql.maintenanceTask.editor`, `managed-opensearch.maintenanceTask.editor`, `managed-postgresql.maintenanceTask.editor`, `managed-redis.maintenanceTask.editor`, and `managed-spqr.maintenanceTask.editor` permissions.

#### vpc.publicAdmin {#vpc-public-admin}

The `vpc.publicAdmin` role allows you to manage NAT gateways, public IP addresses, and external network connectivity, as well as view information on the quotas, resources, and resource operations. This role grants administrator privileges for multi-interface instances that provide connectivity between multiple networks.

{% cut "Users with this role can:" %}

* View the list of [cloud networks](../../vpc/concepts/network.md#network) and info on them, as well as set up external access to them.
* Manage connectivity of multiple cloud networks.
* Manage multi-interface instances that provide connectivity between multiple networks.
* View the list of [subnets](../../vpc/concepts/network.md#subnet) and info on them, as well as modify them.
* View information on [NAT gateways](../../vpc/concepts/gateways.md), as well as create, modify, and delete them.
* View the list of [cloud resource addresses](../../vpc/concepts/address.md) and info on them, as well as create, update, and delete public IP addresses.
* View the list of [route tables](../../vpc/concepts/routing.md#rt-vpc) and info on them, as well as link them to subnets.
* View the list of [security groups](../../vpc/concepts/security-groups.md) and the info on them.
* View information on the IP addresses used in subnets.
* View information on Virtual Private Cloud [quotas](../../vpc/concepts/limits.md#vpc-quotas).
* View information on resource operations for Virtual Private Cloud.
* View information on resource operations for Compute Cloud.
* View information on the relevant [cloud](../../resource-manager/concepts/resources-hierarchy.md#cloud).
* View info on the relevant [folder](../../resource-manager/concepts/resources-hierarchy.md#folder).

{% endcut %}

This role includes the `vpc.viewer` permissions.

You can assign a role for a cloud or folder.

{% note warning %}

If a network and subnet are in different folders, the `vpc.publicAdmin` role is checked for the folder where the network is located.

{% endnote %}

### Primitive roles {#primitive-roles}

Primitive roles allow users to perform actions in all Yandex Cloud [services](../../overview/concepts/services.md).

#### auditor {#auditor}

The `auditor` role grants a permission to read configuration and metadata of any Yandex Cloud resources without any access to data.

For instance, users with this role can:
* View info on a [resource](../../resource-manager/concepts/resources-hierarchy.md).
* View the resource metadata.
* View the list of operations with a resource.

`auditor` is the most secure role that does not grant any access to the [service](../../overview/concepts/services.md) data. This role suits the users who need minimum access to the Yandex Cloud resources.

#### viewer {#viewer}

The `viewer` role grants the permissions to read the info on any Yandex Cloud [resources](../../resource-manager/concepts/resources-hierarchy.md).

This role includes the `auditor` permissions.

Unlike `auditor`, the `viewer` role provides access to [service](../../overview/concepts/services.md) data in read mode.

#### editor {#editor}

The `editor` role provides permissions to manage any Yandex Cloud [resources](../../resource-manager/concepts/resources-hierarchy.md), except for assigning roles to other users, transferring [organization](../../organization/concepts/organization.md) ownership, removing an organization, and deleting Key Management Service [encryption keys](../../kms/concepts/index.md).

For instance, users with this role can create, modify, and delete resources.

This role includes the `viewer` permissions.

#### admin {#admin}

The `admin` role enables assigning any roles, except for `resource-manager.clouds.owner` and `organization-manager.organizations.owner`, and provides permissions to manage any Yandex Cloud [resources](../../resource-manager/concepts/resources-hierarchy.md) (except for transferring [organization](../../organization/concepts/organization.md) ownership and removing an organization).

Prior to assigning the `admin` role for an organization, [cloud](../../resource-manager/concepts/resources-hierarchy.md#cloud), or [billing account](../../billing/concepts/billing-account.md), make sure to check out the information on protecting [privileged accounts](../../security/standard/all.md#privileged-users).

This role includes the `editor` permissions.

Instead of primitive roles, we recommend using service roles with more granular access control, allowing you to implement the [least privilege principle](../../security/standard/all.md#min-privileges).

For more information on primitive roles, see the [Yandex Cloud role reference](../../iam/roles-reference.md#primitive-roles).

## Required roles {#required-roles}

To use the service, you need the [managed-mongodb.editor role or higher](../../iam/concepts/access-control/roles.md) on the folder containing your new cluster. The `managed-mongodb.viewer` role only allows you to view the cluster list.

To create a Yandex StoreDoc cluster, you need the [vpc.user](../../vpc/security/index.md#vpc-user) role and the `managed-mongodb.editor` role or higher.

You can also assign a role with broader permissions, e.g., `managed-mongodb.admin` instead of `managed-mongodb.editor`.

## What's next {#whats-next}

* [How to assign a role](../../iam/operations/roles/grant.md).
* [How to revoke a role](../../iam/operations/roles/revoke.md).
* [Learn more about access management in Yandex Cloud](../../iam/concepts/access-control/index.md).
* [Learn more about role inheritance](../../resource-manager/concepts/resources-hierarchy.md#access-rights-inheritance).