mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
fix to accept login of user that does not have access to Chat
This commit is contained in:
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
|
||||
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Router } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
import { AuthService } from '../services/auth.service';
|
||||
import { PermissionService } from '../services/permission.service';
|
||||
import { LocalstoreService } from '../store/localstore.service';
|
||||
import { SessionStore } from '../store/session.service';
|
||||
|
||||
@@ -13,6 +14,7 @@ export class AuthGuard implements CanActivate {
|
||||
private router:Router,
|
||||
private localstoreService: LocalstoreService,
|
||||
private authService: AuthService,
|
||||
public p: PermissionService,
|
||||
){}
|
||||
|
||||
canActivate(
|
||||
@@ -29,7 +31,10 @@ export class AuthGuard implements CanActivate {
|
||||
this.router.navigate(['/']);
|
||||
return false
|
||||
} else {
|
||||
this.authService.loginChat();
|
||||
if(this.p.userPermission(this.p.permissionList.Chat.access) == true){
|
||||
this.authService.loginChat();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user