public function ViewPaymentsByOwner::access in Payment 8.2
Checks access to the route.
Parameters
\Drupal\user\UserInterface $user:
Return value
\Drupal\Core\Access\AccessResultInterface
1 string reference to 'ViewPaymentsByOwner::access'
File
- src/
Controller/ ViewPaymentsByOwner.php, line 73
Class
- ViewPaymentsByOwner
- Handles the "view payments by owner" route.
Namespace
Drupal\payment\ControllerCode
public function access(UserInterface $user) {
return AccessResult::allowedIf($this->currentUser
->id() == $user
->id() && $this->currentUser
->hasPermission('payment.payment.view.own'))
->orIf(AccessResult::allowedIf($this->currentUser
->hasPermission('payment.payment.view.any')));
}