The authority to issue a TRP is given to officers, and as you've heard before, each decision is made on a case-by-case basis. In issuing the TRP, the officer would consider the reason for the visit, the circumstances around the visit, as well as potential risk to the safety and security of Canada, and they would make a decision based on the balance of those considerations.
On October 24th, 2016. See this statement in context.