public function SupportsPushedReportsAccessCheck::access in SMS Framework 8
Same name and namespace in other branches
- 2.x src/Access/SupportsPushedReportsAccessCheck.php \Drupal\sms\Access\SupportsPushedReportsAccessCheck::access()
- 2.1.x src/Access/SupportsPushedReportsAccessCheck.php \Drupal\sms\Access\SupportsPushedReportsAccessCheck::access()
Checks if the gateway supports pushed reports.
File
- src/
Access/ SupportsPushedReportsAccessCheck.php, line 17
Class
- SupportsPushedReportsAccessCheck
- Checks if gateway supports pushed reports.
Namespace
Drupal\sms\AccessCode
public function access(Request $request) {
if ($request->attributes
->has('sms_gateway')) {
/** @var \Drupal\sms\Entity\SmsGatewayInterface $sms_gateway */
$sms_gateway = $request->attributes
->get('sms_gateway');
return AccessResult::allowedIf($sms_gateway
->supportsReportsPush())
->addCacheContexts([
'route',
])
->addCacheContexts($sms_gateway
->getCacheContexts());
}
return AccessResult::neutral();
}