class SupportsPushedReportsAccessCheck in SMS Framework 8
Same name and namespace in other branches
- 2.x src/Access/SupportsPushedReportsAccessCheck.php \Drupal\sms\Access\SupportsPushedReportsAccessCheck
- 2.1.x src/Access/SupportsPushedReportsAccessCheck.php \Drupal\sms\Access\SupportsPushedReportsAccessCheck
Checks if gateway supports pushed reports.
Hierarchy
- class \Drupal\sms\Access\SupportsPushedReportsAccessCheck implements AccessInterface
Expanded class hierarchy of SupportsPushedReportsAccessCheck
1 string reference to 'SupportsPushedReportsAccessCheck'
1 service uses SupportsPushedReportsAccessCheck
File
- src/
Access/ SupportsPushedReportsAccessCheck.php, line 12
Namespace
Drupal\sms\AccessView source
class SupportsPushedReportsAccessCheck implements AccessInterface {
/**
* Checks if the gateway supports pushed reports.
*/
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();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SupportsPushedReportsAccessCheck:: |
public | function | Checks if the gateway supports pushed reports. |