I was taught that no priest can deny the sacraments from anyone, unless they know for certain that the person asking is a known un-Catholic.
Reason being, even a priest can not judge the soul of a person.
Prior to Vatican II, a Catholic can travel from one place to another, attend Mass, and know for sure if they walk up to the Communion rail they will be offered the Blessed Sacrament.
Another reason to refuse the sacraments today, might be, if a person came to the communion rail with total disrespect, with some odd behavior, or immodest dress, acting as if they do not know what they are doing or it is obvious to the priest that they do not believe but only want to mock the sacrament.