1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-06-11 13:48:13 +03:00

#47 - Adds comment level permissions to the front-end.

This commit is contained in:
Abijeet
2017-06-04 11:17:14 +05:30
parent 6ff440e677
commit 2fd421b115
7 changed files with 41 additions and 15 deletions

View File

@ -88,6 +88,13 @@ class CommentController extends Controller
$this->checkOwnablePermission('page-view', $page);
$comments = $this->commentRepo->getPageComments($pageId);
return response()->json(['success' => true, 'comments'=> $comments['comments'], 'total' => $comments['total']]);
return response()->json(['success' => true, 'comments'=> $comments['comments'],
'total' => $comments['total'], 'permissions' => [
'comment_create' => $this->currentUser->can('comment-create-all'),
'comment_update_own' => $this->currentUser->can('comment-update-own'),
'comment_update_all' => $this->currentUser->can('comment-update-all'),
'comment_delete_all' => $this->currentUser->can('comment-delete-all'),
'comment_delete_own' => $this->currentUser->can('comment-delete-own'),
], 'user_id' => $this->currentUser->id]);
}
}