public function PhotosImageController::access in Album Photos 8.4
A custom access check.
Parameters
\Drupal\Core\Session\AccountInterface $account: Run access checks for this account.
1 string reference to 'PhotosImageController::access'
File
- src/
Controller/ PhotosImageController.php, line 99
Class
- PhotosImageController
- Image view controller.
Namespace
Drupal\photos\ControllerCode
public function access(AccountInterface $account) {
// Check if user can view account photos.
$fid = $this->routeMatch
->getParameter('file');
if (_photos_access('imageView', $fid)) {
// Allow access.
return AccessResult::allowed();
}
else {
return AccessResult::forbidden();
}
}