[Yandex Cloud documentation](../../../index.md) > [Yandex Cloud Functions](../../index.md) > [Step-by-step guides](../index.md) > Managing function access permissions > Making a function private

# Making a function private

For a function to be invoked only by users with the permission to do so, make the function private.

{% note info %}

If all unauthorized users (the `All users` [public group](../../../iam/concepts/access-control/public-group.md)) of a cloud or folder are granted permissions to invoke a function, the function will be public regardless of its settings. For information on how to revoke a role, see [this guide](../../../iam/operations/roles/revoke.md).

{% endnote %}

{% list tabs group=instructions %}

- Management console {#console}

    1. In the [management console](https://console.yandex.cloud), navigate to the folder containing the function.
    1. Navigate to **Cloud Functions**.
    1. Select the function you want to make private.
    1. On the **Overview** page, disable **Public function**.
    
- 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 make a function private, run this command:

    ```bash
    yc serverless function deny-unauthenticated-invoke <function_name>
    ```

    Result:
    ```text
    done (1s)   
    ```

{% endlist %}