Token based authentication and permissions based on https://github.com/mrgamer/angular-login-example