From 84e7355d555f7e19d53f7329a428742b484c6491 Mon Sep 17 00:00:00 2001
From: Hagen <hagen.dressler@mni.thm.de>
Date: Thu, 8 Mar 2018 13:53:19 +0100
Subject: [PATCH] Add routing for component comment

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

diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts
index 41f01d91e..619bdd7ef 100644
--- a/src/app/app-routing.module.ts
+++ b/src/app/app-routing.module.ts
@@ -31,7 +31,12 @@ const routes: Routes = [
     component: RoomComponent,
     canActivate: [AuthenticationGuard]
   },
-  { path: 'room/:roomId/comments', component: CommentComponent },
+  {
+    path: 'room/:roomId/comments',
+    component: CommentComponent,
+    canActivate: [AuthenticationGuard],
+    data: {roles: [UserRole.CREATOR] }
+  },
   { path: 'room/:roomId/create-comment',
     component: CreateCommentComponent,
     canActivate: [AuthenticationGuard],
diff --git a/src/app/room/room.component.html b/src/app/room/room.component.html
index 3b4c66037..581e828d5 100644
--- a/src/app/room/room.component.html
+++ b/src/app/room/room.component.html
@@ -11,6 +11,10 @@
   <button mat-button routerLink="/room/{{room.id}}/create-comment">
     Create comment <!-- Only for participant -->
   </button>
+
+  <button mat-button routerLink="/room/{{room.id}}/comments">
+    Visit comments <!-- Only for creator -->
+  </button>
 </mat-list>
 
 <!-- content-type of room-->
-- 
GitLab