def current_user_owns_tiid(tiid):
    try:
        profile_for_current_user = db.session.query(Profile).get(int(current_user.id))
        db.session.expunge(profile_for_current_user)
        return tiid in profile_for_current_user.tiids
    except __HOLE__:  #Anonymous
        return False
dataset/ETHPy150Open Impactstory/total-impact-webapp/totalimpactwebapp/views.py/current_user_owns_tiid