dev
Last change
on this file since 32cd040 was 32cd040, checked in by Стојков Марко <mst@…>, 3 years ago |
Added generic component for asking questions
|
-
Property mode
set to
100644
|
File size:
448 bytes
|
Line | |
---|
1 | import { Injectable } from '@angular/core';
|
---|
2 | import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
|
---|
3 | import { AuthService } from '../services';
|
---|
4 |
|
---|
5 | @Injectable({
|
---|
6 | providedIn: 'root'
|
---|
7 | })
|
---|
8 | export class AuthorizedStudentGuard implements CanActivate {
|
---|
9 | constructor(private auth: AuthService) {}
|
---|
10 |
|
---|
11 | canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
|
---|
12 | return this.auth.isStudent();
|
---|
13 | }
|
---|
14 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.