diff --git a/src/app/_guards/auth.guard.ts b/src/app/_guards/auth.guard.ts
index 15c9737..072976b 100644
--- a/src/app/_guards/auth.guard.ts
+++ b/src/app/_guards/auth.guard.ts
@@ -7,16 +7,19 @@ export class AuthGuard implements CanActivate {
constructor(private router: Router) { }
/*
- Using CanActivate as route guard and simply checking if the currentUser object is inplace.
+ Using CanActivate as route guard and simply checking if the currentUser object is in place.
This can and should be expanded to validating the token via a service to ensure validity
*/
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
+
+ /* In the real world I would pull this into a local class and have a service validate the token, but for the sake of the demo we'll just accept that this dude is valid*/
if (localStorage.getItem('currentUser')) {
return true;
}
/* If not then kick them back to the login page */
- this.router.navigate( ['login'] );
+ this.router.navigate(['login']);
return false;
}
+
}
\ No newline at end of file
diff --git a/src/app/_guards/role.guard.ts b/src/app/_guards/role.guard.ts
new file mode 100644
index 0000000..c0ca243
--- /dev/null
+++ b/src/app/_guards/role.guard.ts
@@ -0,0 +1,25 @@
+import { Injectable } from '@angular/core';
+import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
+
+@Injectable()
+export class RoleGuard implements CanActivate {
+
+ constructor(private router: Router) { }
+
+ /*
+ Using CanActivate as route guard and simply checking if the currentUser object is inplace.
+ This can and should be expanded to validating the token via a service to ensure validity
+ */
+ canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
+
+ /* In the real world I would pull this into a local class and have a service validate the token, but for the sake of the demo we'll just accept that this dude is valid*/
+ if (JSON.parse(localStorage.getItem('currentUser')).role == "B5") {
+ return true;
+ }
+
+ /* If not then kick them back to the login page */
+ this.router.navigate(['login']);
+ return false;
+ }
+
+}
\ No newline at end of file
diff --git a/src/app/about/about.component.html b/src/app/about/about.component.html
index a9f4663..814bc00 100644
--- a/src/app/about/about.component.html
+++ b/src/app/about/about.component.html
@@ -24,9 +24,17 @@
Also... I love the web because it's the only platform that is truly accepted by everyone, regardless of operating system, country, or government, the web is what ties us all together.
-
+
+
+
+ Application Use
+
+
+ Search for companies currently on the Nasdaq market (start with first 3 letters), click the company name to view past month closing data in graph form. Click the
+ plus icon to add to watch list or the minus icon to remove from watch list. Again clicking on the company name from the watch list will load
+ graph data from the IEX API.
- user-admin works! -
+
+ Well it's Wednesday 9/12/2018 and with all the self inflicted scope creep I have run out of time to build this page.
+
+
+ On the flip side yay the app is done!
+