registerPermissions() was having a redirect loop when user wasn't logged in