jreviews:permission:comment.update
Filters whether a user has permission to update a comment (user or editorial).
You need to have a working knowledge of Hooks before you get started.
Fires when checking comment update permission, after checking comment type-specific permissions @hook jreviews:permission:comment.update_user_comment
Parameters
| Name | Type | Description |
|---|---|---|
$canUpdate |
bool |
Whether the user can update the editorial comment |
$user |
\JReviews\App\Models\User |
The user attempting to update the comment |
$comment |
\JReviews\App\Models\Comment |
The editorial comment being updated |
Boilerplate Code
Use the boilerplate code to start using the filter, and add your own logic to modify the first argument and return it.
fwd_add_filter('jreviews:permission:comment.update', function($canUpdate, $user, $comment)
{
// Your code here
return $canUpdate;
});
Source Files
app/Policies/CommentPolicy.php