Unfortunately, an officer must rely on the "official" answer to that question, which is the response of his legal team-- this applies not only to Constitutional issues, but also to unlawful orders. Given the track history of even the supreme court to never check clearly unconstitutional actions, it should be no surprise that the legal teams will pretty much permit anything.
If the officer then acts, he is the one engaging in illegal activity, on multiple counts of the most serious charges possible, that will see him executed or imprisoned for life.