How to structure a multi-pass shader system

How would I structure an rendering system with OpenGL? ( Specifically for a game engine, really )

How I’ve been doing it lately:

void render(){
      for(Program shader : shaders); shader.use();
            for(WorldEntity e : worldEntites); e.render(shader);
}

But the problem here is that it doesn’t allow for per-entity shaders… Which I may really need for some specific game things.
Adding a shader list to the world entities is out of the equation completely because it would interfere with the parent world’s current shader.

So my question is, how do you guys handle this kinda stuff?