When the United Nations’ top anti-torture official tried to inspect an infamous prison in Gambia two years ago, officials there denied him access. So he protested all the way up the country’s chain of command.

In a tense meeting with members of the cabinet of the country’s autocratic ruler, the United Nations official, Juan E. Méndez, was again denied, this time with a jeering dismissal. “They said, ‘Why don’t you go to Guantánamo instead,’” recalled Mr. Mendez, a former United Nations special rapporteur on torture.

In Bahrain, officials were a little more subtle, but the message was the same, as they twice canceled prison inspection visits. “They said we face the same threats to national security as other countries face,” Mr. Mendez said. “It was clear they were referring to the United States, and they didn’t feel that they needed to give me access.”

Now, after President-elect Donald J. Trump’s campaign vows to reinstate the sort of torture used in the Bush-era war on terrorism — and to fill the Guantánamo Bay prison with “some bad dudes” — human rights experts fear that authoritarian regimes around the world will see it as another green light to carry out their own abuses.