Skip to content

Instantly share code, notes, and snippets.

View bryanschoot's full-sized avatar
🏠
Working from home

Bryan Schoot bryanschoot

🏠
Working from home
  • Bryan Schoot
  • The Netherlands
View GitHub Profile
@lukichev
lukichev / auth.guard.ts
Last active January 18, 2023 10:15
Role based router permissions
// auth.guard.ts
import {Injectable} from '@angular/core';
import {Router, CanActivate, RouterStateSnapshot, ActivatedRouteSnapshot} from '@angular/router';
import {AuthService} from './auth.service';
@Injectable()
export class AuthGuard implements CanActivate {
constructor(private router: Router,
private authService: AuthService) {
}