jreviews:permission:media.download
Filters whether a user has permission to download a media file.
You need to have a working knowledge of Hooks before you get started.
Fires when checking if user can download media files
Parameters
| Name | Type | Description |
|---|---|---|
$canDownload |
bool |
Whether the user can download the media |
$user |
\JReviews\App\Models\User |
The user attempting to download |
$media |
\JReviews\App\Models\Media |
The media being downloaded |
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:media.download', function($canDownload, $user, $media)
{
// Your code here
return $canDownload;
});
Source Files
app/Policies/MediaPolicy.php