Commit cad45af6cb6bb7f2430ec5e1bde85071989fc4b6

Authored by Victor Costa
2 parents 6ee33b19 9d4ccd3a

Merge branch 'destroy_permission_for_article' into 'master'

Checks whether comment can be destroyed by the user

See merge request !61
src/app/article/comment/comment.component.ts
... ... @@ -2,6 +2,8 @@ import { Inject, Input, Component, Output, EventEmitter } from 'ng-forward';
2 2 import { PostCommentComponent } from "./post-comment/post-comment.component";
3 3 import { CommentService } from "../../../lib/ng-noosfero-api/http/comment.service";
4 4 import { NotificationService } from "../../shared/services/notification.service";
  5 +import { PermissionDirective } from '../../shared/components/permission/permission.directive';
  6 +
5 7  
6 8 @Component({
7 9 selector: 'noosfero-comment',
... ...
src/app/article/comment/comment.html
... ... @@ -22,7 +22,7 @@
22 22 <span class="bullet-separator">•</span>
23 23 {{"comment.reply" | translate}}
24 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 26 <span class="bullet-separator">•</span>
27 27 {{"comment.remove" | translate}}
28 28 </a>
... ...