Skip to content

Commit

Permalink
include interjections based on user role
Browse files Browse the repository at this point in the history
  • Loading branch information
shehan committed Apr 24, 2017
1 parent 825743c commit 6a4352c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion client/js/group-chat-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,20 @@
$http.get('services/interjection/get-interjections-for-group', {params: {GroupId: $scope.groupID}})
.then(function (response) {

$scope.groupInterjections = response.data.interjections;
if (AuthService.authenticatedUser().roleID === '21' || AuthService.authenticatedUser().roleID === '31'){ //role ID's for Captionist and Interpreter
for(var i=0; i<response.data.interjections; i++)
{
if(response.data.interjections[i].IncludeCaptionist === true && AuthService.authenticatedUser().roleID === '21'){
$scope.groupInterjections.push(response.data.interjections[i])
}
if(response.data.interjections[i].IncludeInterpreter === true && AuthService.authenticatedUser().roleID === '31'){
$scope.groupInterjections.push(response.data.interjections[i])
}
}
}
else{
$scope.groupInterjections = response.data.interjections;
}

$scope.communicateInterjection = {
Title: "Communicating!",
Expand Down

0 comments on commit 6a4352c

Please sign in to comment.