Commit 9d4ccd3a4eb922d1a3a22a4aa604232353adb4e1

Authored by Evandro Junior
Committed by Victor Costa
1 parent 6ee33b19

checks whether comment can be destroyed by the user

src/app/article/comment/comment.component.ts
@@ -2,6 +2,8 @@ import { Inject, Input, Component, Output, EventEmitter } from 'ng-forward'; @@ -2,6 +2,8 @@ import { Inject, Input, Component, Output, EventEmitter } from 'ng-forward';
2 import { PostCommentComponent } from "./post-comment/post-comment.component"; 2 import { PostCommentComponent } from "./post-comment/post-comment.component";
3 import { CommentService } from "../../../lib/ng-noosfero-api/http/comment.service"; 3 import { CommentService } from "../../../lib/ng-noosfero-api/http/comment.service";
4 import { NotificationService } from "../../shared/services/notification.service"; 4 import { NotificationService } from "../../shared/services/notification.service";
  5 +import { PermissionDirective } from '../../shared/components/permission/permission.directive';
  6 +
5 7
6 @Component({ 8 @Component({
7 selector: 'noosfero-comment', 9 selector: 'noosfero-comment',
src/app/article/comment/comment.html
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 <span class="bullet-separator">•</span> 22 <span class="bullet-separator">•</span>
23 {{"comment.reply" | translate}} 23 {{"comment.reply" | translate}}
24 </a> 24 </a>
25 - <a href="#" (click)="ctrl.remove()" class="action small text-muted remove" ng-if="ctrl.allowRemove()"> 25 + <a permission="ctrl.comment.permissions" permission-action="allow_destroy" href="#" (click)="ctrl.remove()" class="action small text-muted remove" ng-if="ctrl.allowRemove()">
26 <span class="bullet-separator">•</span> 26 <span class="bullet-separator">•</span>
27 {{"comment.remove" | translate}} 27 {{"comment.remove" | translate}}
28 </a> 28 </a>