Skip to content

Instantly share code, notes, and snippets.

View gpolanco's full-sized avatar

Geordano Polanco gpolanco

View GitHub Profile
@gpolanco
gpolanco / authentication.ts
Created July 9, 2017 11:03 — 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){