The "correct" answer is of course, comply with whatever the person claiming to be a cop says, no matter it's legallity, after all what's wrong with that".
The laws vary of course. US applies below.
Unless the mall it self says "No photography", it's legal to take photos there, as it is in any public space.
If the mall says it is not allowed, it is still legal. If you are told to stop and continue, you can be asked to leave. If you refuse to leave, you can be charged for trespass.
Cops do not have the right to review your shots, insist you delete them, nor take your gear.
You do not need peoples permission to photograph them in any public space.
It is legal to take pictures of cops in public. The fact that they may be "undercover", may not like it, may have a stick up their *** about it, doesn't matter.
It's legal.
Please note, I'm not saying it's always right, but it's almost always legal.
In the US you can photograph almost anything and anyone, provided you aren't breaking other laws (trespass, invasion of privacy, etc).
What you can then do with those photos depends on what if any releases you may need/have.
I can go down to the beach, sit there all day long, and take 1,000 photos of little kids in little swimsuits as they play in plain view on a public beach, and unless the beach has a rule against photography, it's 100% legal. At most, they can ask me to leave. They have no right to review the shots, nor confiscate my camera, nor delete shots.
As to the UK, well, it seems it depends on if the cops got the memos and read them on if it's even legal to be near a camera.
Some UK police did not get last week’s memo
It is now legal to take pictures in public in the UK
UK cops still having problems with suspected terrorists carrying cameras
Of course, in the US we can't even get it straight if it's ok to take pictures to enter into an official photo contest for Amtrak, so it's universal panic and FUD it seems.Situations like this, you need to balance "legal" and "correct. It sounds like the photographer did everything right, but ran into someone who felt he was the law, while unaware of the law, who assaulted the photographer. I've taken photos of cops, haven't had any problems yet. I avoid sensitive situations, and if I ever do have an issue will try to diffuse it politely. Worst case, I will delete the shot. Then after he's gone, I'll swap the card out, use recovery software later and restore the shot
.