Commit cad45af6cb6bb7f2430ec5e1bde85071989fc4b6
Exists in
master
and in
4 other branches
Merge branch 'destroy_permission_for_article' into 'master'
Checks whether comment can be destroyed by the user See merge request !61
Showing
2 changed files
with
3 additions
and
1 deletions
Show diff stats
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> | ... | ... |