Was This Cop Within His Authority To Arrest This Man?

He was being a bit of a dick, but was it illegal?