Returns the type of subscription for the given user to this
    discussion. This does not check authorizations (for eg. if user
    was subscribed, but is suddenly no longer authorized).

    :param recID: record ID
    :param uid: user id
    :return:
               - 0 if user is not subscribed to discussion
               - 1 if user is subscribed, and is allowed to unsubscribe
               - 2 if user is subscribed, but cannot unsubscribe

def get_user_subscription_to_discussion(recID, uid):
    """
    Returns the type of subscription for the given user to this
    discussion. This does not check authorizations (for eg. if user
    was subscribed, but is suddenly no longer authorized).

    :param recID: record ID
    :param uid: user id
    :return:
               - 0 if user is not subscribed to discussion
               - 1 if user is subscribed, and is allowed to unsubscribe
               - 2 if user is subscribed, but cannot unsubscribe
    """
    user_email = User.query.get(uid).email
    (emails1, emails2) = get_users_subscribed_to_discussion(
        recID, check_authorizations=False)
    if user_email in emails1:
        return 1
    elif user_email in emails2:
        return 2
    else:
        return 0