[Yandex Cloud documentation](../../../index.md) > [Yandex Cloud Functions](../../index.md) > [Step-by-step guides](../index.md) > Managing function access permissions > Viewing roles assigned for a function

# Viewing roles assigned for a function

{% note info %}

A function automatically [inherits](../../../iam/concepts/access-control/index.md#inheritance) [roles](../../security/index.md#roles-list) assigned for a folder, cloud, or organization. However, they are not displayed in the list of assigned roles. You can learn more about viewing roles [here](../../../iam/operations/roles/get-assigned-roles.md).

{% endnote %}

{% list tabs group=instructions %}

- 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.

    To view [roles](../../security/index.md#roles-list) assigned for a function, run this command:
    
    ```bash
    yc serverless function list-access-bindings <function_name>
    ```

    Result:
    ```text
    +------------------------------+--------------+-----------------------+
    |           ROLE ID            | SUBJECT TYPE |       SUBJECT ID      |
    +------------------------------+--------------+-----------------------+
    | functions.functionInvoker    | system       | allAuthenticatedUsers |
    +------------------------------+--------------+-----------------------+
    ```

- API {#api}

  To view roles for a function, use the [listAccessBindings](../../functions/api-ref/Function/listAccessBindings.md) REST API method for the [Function](../../functions/api-ref/Function/index.md) resource or the [FunctionService/ListAccessBindings](../../functions/api-ref/grpc/Function/listAccessBindings.md) gRPC API call.

{% endlist %}