they have the right, during a border crossing, yes.
same for US, Australia, and Canada.
Police states!
just wipe your devices and recover on the other side. pain in the ass, but enforces good digital hygiene.