i used Angular 2 to create a web, i want to enable or disable some sidebar components according to user login data, login data of user is stored in json and through a Qwebchannel a token is passed in locolhost for authentication, now what i want is to enable or disable some sidebar component according to user login token...
ReDirectToNextPage(user: string){
setTimeout(function () {
location.reload();
}, 1);
console.log('ReDirectToNextPage called from JS');
this.tokenStorage.saveToken("login#username:" + user);
this.router.navigate(['server-config']);
}
checkLogin() {
if (this.tokenStorage.getToken() != undefined && this.tokenStorage.getToken() != null && this.tokenStorage.getToken().indexOf("login") != -1) {
this.router.navigate(['server-config']);
} else {
const card = document.getElementsByClassName('card')[0];
setTimeout(function () {
card.classList.remove('card-hidden');
}, 700);
}
}
this is what i tried i am getting token for loggedIN user i want to show only assign rights to loggedIN user (rights vary from user login) Thanks