def check_user_permission(permissions, user_info):
    """ Returns the first permission the user validates to.

    Looks up every permission in the given list of permissions, and when one
    validates, it returns that perm as a result

    Args:
        permissions: List containing permissions in string format
        user_info: the result from handle_session_data() to check against

    Returns:
        perm: the string permission we first positively validated against
    """
    for permission in permissions:
        try:
            perm = user_info.permissions[permission]
        except KeyError:
            perm = False
        if perm:
            break
    return perm
