proper admin page fix
This commit is contained in:
@@ -22,10 +22,15 @@ export class NewItemComponent {
|
|||||||
|
|
||||||
constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication ) {
|
constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication ) {
|
||||||
this.title.setTitle("New | ADMIN");
|
this.title.setTitle("New | ADMIN");
|
||||||
if (auth.isLoggedIn){
|
|
||||||
if (auth.loggedInUser.siteData.role != "Admin"){
|
// If user is not logged in -> route home
|
||||||
router.navigate(["/"]);
|
if (!auth.isLoggedIn){
|
||||||
}
|
router.navigate(["/"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// If user is not Admin -> route home
|
||||||
|
if (auth.loggedInUser.siteData.role != "Admin"){
|
||||||
|
router.navigate(["/"]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user