diff --git a/src/app/components/shared/room-list/room-list.component.ts b/src/app/components/shared/room-list/room-list.component.ts index 579379358af6a0f4177ddc26f60eb3155f9c5635..71a9bc0819f2d9fc97008f43f923f6f89a9dbfbd 100644 --- a/src/app/components/shared/room-list/room-list.component.ts +++ b/src/app/components/shared/room-list/room-list.component.ts @@ -42,15 +42,15 @@ export class RoomListComponent implements OnInit { getRooms(): void { this.roomService.getParticipantRooms().subscribe(rooms => this.updateRoomList(rooms)); - this.roomService.getCreatorRooms().subscribe(rooms => this.updateRoomList(rooms, true)); + this.roomService.getCreatorRooms().subscribe(rooms => this.updateRoomList(rooms)); } - updateRoomList(rooms: Room[], isOwner: boolean = false) { + updateRoomList(rooms: Room[]) { this.rooms = this.rooms.concat(rooms); this.closedRooms = this.rooms.filter(room => room.closed); this.roomsWithRole = this.rooms.map(room => { const roomWithRole: RoomRoleMixin = <RoomRoleMixin>room; - if (isOwner) { + if (this.authenticationService.hasAccess(room.shortId, UserRole.CREATOR)) { roomWithRole.role = UserRole.CREATOR; } else { // TODO: acknowledge the other role option too