def user_controls_client(user, client):
    """
    Checks whether the given user can control the given client instance.

    @param user: The user to check against.
    @param client: The client to be checked.
    @return: True if the given user controls the given client, False otherwise.
    """

    return user.is_admin or user.id == client.user_id