UN membership? Uh? You refer to the corrupt and inept UN?  UN endorsements and resolutions are NOT law in sovereign countries.
One of the few responsibilities of nation states like Sweden and Canada is protection of it's citizens from threats. Sweden in this case failed miserably and failed its responsibility to its citizens.
Thankfully we have nations like  Japan, Czech, Switzerland,  US, Hungary, Poland and leaders like Trump who take the security of their citizens seriously against outside threats.
The world is a brutal and unforgiving place and the corrupt UN doesn't protect citizens of the member countries. Only nation states can protect their citizens