Yes, my case was (probably, maybe) barred from injunctive relief because you can't sue to fix problems at a jail or prison if they release you[0]. Some people have been prematurely released just to activate this option.
You can (sometimes) get declaratory judgment though, which at least declares you a winner and you can then pass the baton to the guy behind you who is still behind bars and use that as a stick to hit the institution over the head with.
And sometimes you can also get monetary damages too, which can be another stick to hit them with.
[0] some exceptions apply if the case is likely to repeat itself, but this argument is very, very hard to muster
Or does class-action not apply to this kind of violation at all?
Law doesn't work like cryptocurrencies. Two different judges can see the same motions and make completely different judgements.
The appellate courts do the real work of determining the legality of the judge's decisions and fixing them where necessary. If you don't have the resources to marshall a competent appeal, then you're usually out of luck.
My case involved access to news and mail delivery. The mail delivery claim is left open for a future class action as the judge made an excellent ruling on it, just short of handing me victory. The person behind me can cite that persuasive ruling to bring a class action if they can find representation.