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