Skip to content

Instantly share code, notes, and snippets.

View embarq's full-sized avatar
🕶️
Working hard

Li Ihor embarq

🕶️
Working hard
View GitHub Profile
@embarq
embarq / authentication.ts
Created November 1, 2016 20:43 — forked from btroncone/authentication.ts
Angular 2 application role access decorator, wrapping built in CanAccess functionality. Prevents view transitions when user roles are not appropriate.
import { Injectable } from 'angular2/core';
import { Storage } from './storage';
import { CurrentUser } from '../interfaces/common';
@Injectable()
export class Authentication{
private _storageService : Storage;
private _userKey : string = "CURRENT_USER";
constructor(storageService : Storage){