def METHOD_NAME(view_func):
    """
    Decorator for views that checks that the user is logged in and can download grades
    """
    def check_user(user):
        return user.can_download_grades
    return user_passes_test(check_user)(view_func)