Skip to content

Instantly share code, notes, and snippets.

View jdefreites's full-sized avatar
🎯
Focusing

Jason De Freites jdefreites

🎯
Focusing
View GitHub Profile
@jdefreites
jdefreites / authentication.ts
Created February 15, 2017 04:51 — 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){