If they are linear, you could use a simple int counter, e.g. “progress”. At an appropriate moment, it checks how far the player got, and all levels lower and equal the counter are considered open. If you complete a level, just add +1 to progress.
If it is not linear, I’d use a list of bools, or enum flags.