Rick Ross just got indicted in the alleged pistol whipping of his groundskeeper, but TMZ has learned his attorney thinks there's no case here ... because Ross was acting in self-defense.
Ross' attorney, Steve Sadow, gave the court a heads up he believes Ross should be immune from criminal prosecution because the groundskeeper was committing felonies on Ross' property -- which means the rapper would be within his rights to beat up the man.
Ross has claimed Jonathan Zamudio, the groundskeeper, was partying with cocaine and drug paraphernalia in the guest house of Ross' Georgia estate.
Sadow says he will make the case that Ross was "acting in self-defense and in defense of his property when he encountered trespassers."
A grand jury handed up several charges last week ... including kidnapping, aggravated battery, aggravated assault, and possession of a firearm while committing a crime.