# Viewing roles assigned for a resource

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the [folder](../../../resource-manager/concepts/resources-hierarchy.md#folder) where you want to view the [roles](../../../iam/concepts/access-control/roles.md) assigned for a resource.
  1. Navigate to **Container Registry**.
  1. Select a [registry](../../concepts/registry.md) or [repository](../../concepts/repository.md) in it.
  1. Navigate to the **Access bindings** tab.
  1. Find the required user, group, or [service account](../../../iam/concepts/users/service-accounts.md) in the list. Assigned roles are specified in the **Roles** column.

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  Run this command:

  ```bash
  yc container <resource> list-access-bindings <resource_name_or_ID>
  ```

  Where:
  * `<resource>`: `registry` or `repository` resource type.
  * `<resource_name_or_ID>`: Name or ID of the resource you want to view the assigned roles for.

  **Example**
  
  ```bash
  yc container registry list-access-bindings my-first-registry
  ```

  Result:
  
  ```bash
  +--------------------------+---------------+----------------------+
  |         ROLE ID          | SUBJECT TYPE  |      SUBJECT ID      |
  +--------------------------+---------------+----------------------+
  | container-registry.admin | federatedUser | ajekv7lpqpgu******** |
  +--------------------------+---------------+----------------------+
  ```

- API {#api}

  Use the [listAccessBindings](../../api-ref/Registry/listAccessBindings.md) REST API method for the [Registry](../../api-ref/Registry/index.md) resource or the [RegistryService/listAccessBindings](../../api-ref/grpc/Registry/updateAccessBindings.md) gRPC API call.

  Use the [listAccessBindings](../../api-ref/Repository/listAccessBindings.md) REST API method for the [Repository](../../api-ref/Repository/index.md) resource or the [RepositoryService/listAccessBindings](../../api-ref/grpc/Repository/updateAccessBindings.md) gRPC API call.

{% endlist %}

You can read more about role management in the Yandex Identity and Access Management [documentation](../../../iam/concepts/index.md).