mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-19 06:31:30 +00:00
#47 - Adds comment level permissions to the front-end.
This commit is contained in:
parent
6ff440e677
commit
2fd421b115
7 changed files with 41 additions and 15 deletions
app/Http/Controllers
|
@ -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]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue