diff --git a/app/Http/Controllers/Issues/CommentController.php b/app/Http/Controllers/Issues/CommentController.php index 31f9888..1894e32 100644 --- a/app/Http/Controllers/Issues/CommentController.php +++ b/app/Http/Controllers/Issues/CommentController.php @@ -44,6 +44,8 @@ class CommentController extends Controller */ public function update(Request $request, Issue $issue, Comment $comment) { + $this->authorize('update', $comment); + $commentData = $request->validate([ 'body' => 'required|string|max:255', ]); diff --git a/resources/views/projects/issues/index.blade.php b/resources/views/projects/issues/index.blade.php index a582c34..e90ff77 100755 --- a/resources/views/projects/issues/index.blade.php +++ b/resources/views/projects/issues/index.blade.php @@ -45,7 +45,7 @@ @empty - {{ __('issue.empty') }} + {{ __('issue.empty') }} @endforelse diff --git a/resources/views/projects/issues/partials/comment-section.blade.php b/resources/views/projects/issues/partials/comment-section.blade.php index 094df69..3cc9d69 100644 --- a/resources/views/projects/issues/partials/comment-section.blade.php +++ b/resources/views/projects/issues/partials/comment-section.blade.php @@ -5,7 +5,9 @@ {{ $comment->creator->name }}
- {{ link_to_route('projects.issues.show', __('app.edit'), [$project, $issue, 'action' => 'comment-edit', 'comment_id' => $comment->id], ['id' => 'edit-comment-'.$comment->id, 'class' => 'small', 'title' => __('comment.edit')]) }} + @can('update', $comment) + {{ link_to_route('projects.issues.show', __('app.edit'), [$project, $issue, 'action' => 'comment-edit', 'comment_id' => $comment->id], ['id' => 'edit-comment-'.$comment->id, 'class' => 'small', 'title' => __('comment.edit')]) }} + @endcan
{!! nl2br($comment->body) !!}