Setting up an app w/ IonicPage and deeplinks

This is more of a design question.

Given a basic master/detail app with the following IonicPages / routes:

Where can I go about setting up the following checks:

  1. user is logged in, if not route to /login
  2. user has permissions to view item, if not route to /404

There are two challenges here, the UI can hide content from the person they are not meant to see, however since the url can be manually changed I want to be able to handle the permission. With the IonViewCanEnter / IonViewCanLeave if I set it to a page, and it returns false, then I just am looking at a blank page because I assume the router does not know what to set as the root page at that point.