Skip to content

Instantly share code, notes, and snippets.

View wbmedia's full-sized avatar
💭
I may be slow to respond.

Antonio Nicasio wbmedia

💭
I may be slow to respond.
View GitHub Profile
@wbmedia
wbmedia / authentication.ts
Created February 13, 2017 17:41 — 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){