$scope.isAuthor = function () {
        var isAuthor = false;
        if ($scope.user) {
            $scope.post.authors.forEach(function (author) {
                if (author.userId === $scope.user._id) {