From dfc01b593d6bc724d102447647cf3eeb02bf9323 Mon Sep 17 00:00:00 2001
From: Hagen <hagen.dressler@mni.thm.de>
Date: Thu, 8 Mar 2018 13:30:40 +0100
Subject: [PATCH] Edit authentication for component create-comment

---
 src/app/app-routing.module.ts    | 3 ++-
 src/app/room/room.component.html | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts
index ae91199e7..1d63c1420 100644
--- a/src/app/app-routing.module.ts
+++ b/src/app/app-routing.module.ts
@@ -31,7 +31,8 @@ const routes: Routes = [
   },
   { path: 'room/:roomId/create-comment',
     component: CreateCommentComponent,
-    canActivate: [AuthenticationGuard]
+    canActivate: [AuthenticationGuard],
+    data: { roles: [UserRole.PARTICIPANT] }
   },
   { path: '**', component: PageNotFoundComponent }
 ];
diff --git a/src/app/room/room.component.html b/src/app/room/room.component.html
index c53d31329..28ddbdd81 100644
--- a/src/app/room/room.component.html
+++ b/src/app/room/room.component.html
@@ -7,6 +7,10 @@
   <mat-list-item>Name: {{room.name}}</mat-list-item>
   <mat-list-item>Description: {{room.description}}</mat-list-item>
   <mat-list-item>Closed: {{room.closed}}</mat-list-item>
+
+  <button mat-button routerLink="/room/{{room.id}}/create-comment">
+    Create comment
+  </button>
 </mat-list>
 
 <!-- content-type of room-->
-- 
GitLab