As someone who keeps fish in aquaria, and have done for 25 years, I can tell you this is definitely NOT illegal. This fish looks healthy, a fine specimen, and the tank also looks healthy - clear water, appropriate equipment in use, etc etc.
HOWEVER - it is common to see large fish in display aquaria like this, and they can, and do, out-grow their tanks. If large fish are kept in a glass box that is too small, they will suffer more disease, shorter lifespan and the question of cruelty certainly does (and should) come up.
Now, how big is this tank? If the notice about "Please do not touch the glass ..." is printed on A4 paper (my assumption), then this tank is actually 8 FT long, which is quite a decent sized tank. (In a large warehouse space, size of tank can be deceptively large.) The depth of the tank (water height) is 2.5 FT. Most (but certainly not all) tanks are square if you look them on the end, so this would be 2.5 FT wide also, or about 75 cms. In the photo you posted, it is rather hard to see, but it could potentially be wider, e.g. 3 ft or 90cms, or even more.
The criterion for tank size in this sort of situation is making sure the fish has plenty of room to turn around. A common rule of thumb is that the width of the tank is at least twice the length of the biggest fish. It is usually the width of the tank, rather than the length, that violates the guidelines on fishkeeping. With my assumptions above, for a 50cms fish, this tank is on or just below the guidelines, so it is starting to outgrow this tank. Fish grow very slowly as they age, so it could be a number of years before it becomes a serious issue.
But this example is very far from the worst I've seen, and may even still (just) meet guidelines. Note these are guidelines for healthy fishkeeping and NOT laws.