[DEV] still work
This commit is contained in:
parent
40a76b7290
commit
ecb422e18b
@ -23,7 +23,7 @@ import { ALL_GUARDS } from "./kar-cw.guard";
|
||||
ReactiveFormsModule,
|
||||
],
|
||||
providers: [
|
||||
//...ALL_SERVICES,
|
||||
...ALL_SERVICES,
|
||||
...ALL_GUARDS,
|
||||
],
|
||||
exports: [
|
||||
|
@ -130,10 +130,9 @@ export class SessionService {
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class OnlyUsersGuard {
|
||||
constructor(/*private sessionService: SessionService, */private router: Router) { }
|
||||
constructor(private sessionService: SessionService, private router: Router) { }
|
||||
|
||||
canActivate() {
|
||||
/*
|
||||
console.log('OnlyLoggedInUsers');
|
||||
if (this.sessionService.hasRight(UserRoles222.user) || this.sessionService.hasRight(UserRoles222.admin)) {
|
||||
return true;
|
||||
@ -141,7 +140,6 @@ export class OnlyUsersGuard {
|
||||
this.router.navigateByUrl('/forbidden');
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -150,16 +148,15 @@ export class OnlyUsersGuard {
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class OnlyUsersGuardHome {
|
||||
constructor(/*private sessionService: SessionService, */private router: Router) { }
|
||||
constructor(private sessionService: SessionService, private router: Router) { }
|
||||
|
||||
canActivate() {/*
|
||||
canActivate() {
|
||||
if (this.sessionService.hasRight(UserRoles222.user) || this.sessionService.hasRight(UserRoles222.admin)) {
|
||||
return true;
|
||||
} else {
|
||||
this.router.navigateByUrl('/unregistered');
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -167,16 +164,15 @@ export class OnlyUsersGuardHome {
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class OnlyUnregisteredGuardHome {
|
||||
constructor(/*private sessionService: SessionService, */private router: Router) { }
|
||||
constructor(private sessionService: SessionService, private router: Router) { }
|
||||
|
||||
canActivate() {/*
|
||||
canActivate() {
|
||||
if (!this.sessionService.islogged()) {
|
||||
return true;
|
||||
} else {
|
||||
this.router.navigateByUrl('/home');
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -184,16 +180,15 @@ export class OnlyUnregisteredGuardHome {
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class OnlyAdminGuard {
|
||||
constructor(/*private sessionService: SessionService, */private router: Router) { }
|
||||
constructor(private sessionService: SessionService, private router: Router) { }
|
||||
|
||||
canActivate() {/*
|
||||
canActivate() {
|
||||
if (this.sessionService.hasRight(UserRoles222.user)) {
|
||||
return true;
|
||||
} else {
|
||||
this.router.navigateByUrl('/forbidden');
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user