Indeed. A state can pass whatever legislation, but it's not the highest authority in EU member states. States still have to obey the various agreements, treaties and rulings, although enforcing that falls back onto the member states themselves. So a sufficiently determined government (Poland/PiS, Hungary) can still get away with a lot.