public function DownloadController::accessUserDownloads in Ubercart 8.4
Checks access for a list of the user's purchased file downloads.
Parameters
\Drupal\Core\Session\AccountInterface $account: Run access checks for this account.
Return value
\Drupal\Core\Access\AccessResultInterface The access result.
1 string reference to 'DownloadController::accessUserDownloads'
- uc_file.routing.yml in uc_file/
uc_file.routing.yml - uc_file/uc_file.routing.yml
File
- uc_file/
src/ Controller/ DownloadController.php, line 191
Class
- DownloadController
- Handles administrative view of files that may be purchased and downloaded.
Namespace
Drupal\uc_file\ControllerCode
public function accessUserDownloads(AccountInterface $account) {
$user = $this
->currentUser();
return AccessResult::allowedIf($user
->id() && ($user
->hasPermission('view all downloads') || $user
->id() == $account
->id()));
}