Groups whose non-permutable subgroups satisfy certain conditions