From 9f6db1f22771e2036f4327959194e702e09e4fe3 Mon Sep 17 00:00:00 2001 From: Gerard Date: Tue, 12 Dec 2023 16:48:54 +0100 Subject: [PATCH] set user and admin persmissions for user, CRU; for admin CRUD --- src/app/app-routing.module.ts | 2 +- .../coordinate-detail/coordinate-detail.component.ts | 3 +-- .../coordinate/coordinate-list/coordinate-list.component.html | 2 +- .../coordinate/coordinate-list/coordinate-list.component.ts | 3 +-- src/app/navbar/navbar.component.html | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 7b43e17..493d934 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -31,7 +31,7 @@ const routes: Routes = [ { path: 'about', component: AboutComponent}, { path: '404', component: NotFoundComponent}, { path: '', redirectTo: 'about', pathMatch: 'full'}, - { path: 'coordinates', loadChildren: () => import('./coordinate/coordinate-routing.module').then(m => m.CoordinateRoutingModule), canActivate: [CheckIsNotAdminGuard]}, + { path: 'coordinates', loadChildren: () => import('./coordinate/coordinate-routing.module').then(m => m.CoordinateRoutingModule), canActivate: [CheckLoggedInGuard]}, ]; @NgModule({ diff --git a/src/app/coordinate/coordinate-detail/coordinate-detail.component.ts b/src/app/coordinate/coordinate-detail/coordinate-detail.component.ts index 02eb0c0..8eb6d19 100644 --- a/src/app/coordinate/coordinate-detail/coordinate-detail.component.ts +++ b/src/app/coordinate/coordinate-detail/coordinate-detail.component.ts @@ -30,8 +30,7 @@ export class CoordinateDetailComponent implements OnInit { } isRole(role: string): boolean { - // return this.authenticationService.isRole(role); - return true; + return this.authenticationService.isRole(role); } goBackToPrevPage(): void { diff --git a/src/app/coordinate/coordinate-list/coordinate-list.component.html b/src/app/coordinate/coordinate-list/coordinate-list.component.html index a71c017..6400419 100644 --- a/src/app/coordinate/coordinate-list/coordinate-list.component.html +++ b/src/app/coordinate/coordinate-list/coordinate-list.component.html @@ -5,7 +5,7 @@

Coordinates List

-
diff --git a/src/app/coordinate/coordinate-list/coordinate-list.component.ts b/src/app/coordinate/coordinate-list/coordinate-list.component.ts index c5425a1..d84b3d5 100644 --- a/src/app/coordinate/coordinate-list/coordinate-list.component.ts +++ b/src/app/coordinate/coordinate-list/coordinate-list.component.ts @@ -98,8 +98,7 @@ export class CoordinateListComponent implements OnInit { } isRole(role: string): boolean { - // return this.authenticationService.isRole(role); - return true; + return this.authenticationService.isRole(role); } getCurrentUserName(): string { diff --git a/src/app/navbar/navbar.component.html b/src/app/navbar/navbar.component.html index 55b5ad8..785d2e0 100644 --- a/src/app/navbar/navbar.component.html +++ b/src/app/navbar/navbar.component.html @@ -32,7 +32,7 @@