When is using a hidden camera illegal?

When is using a hidden camera illegal?