Essentially as a result of history, the UK does not have a formal codified constitution but it does have constitutional arrangements which include the Legislative Supremacy of Parliament.
As
Parliament itself notes -
'Parliamentary sovereignty is a principle of the UK constitution. It makes Parliament the supreme legal authority in the UK, which can create or end any law. Generally, the courts cannot overrule its legislation and no Parliament can pass laws that future Parliaments cannot change. Parliamentary sovereignty is the most important part of the UK constitution.'
A weakness of that principle is that whoever controls Parliament has, in effect, the ability to try to enact ANY law they wish. In law, there is nothing that Parliament cannot change but there are both practical and political constraints.
One Parliament has enacted legislation there is no court with power to declare the legislation unconstitutional.
Furthermore,