Limit adming page to the admin group
This commit is contained in:
@@ -22,6 +22,11 @@ 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"){
|
||||||
|
router.navigate(["/"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
sleep(ms: number) {
|
sleep(ms: number) {
|
||||||
|
|||||||
Reference in New Issue
Block a user