public function AccessController::access in Social media share 8
Check if email option is enabled, if not do not allow this path.
Return value
\Drupal\Core\Access\AccessResultInterface Return allowed if the social media email is enabled.
1 string reference to 'AccessController::access'
File
- src/
Controller/ AccessController.php, line 21
Class
- AccessController
- Class AccessController.
Namespace
Drupal\social_media\ControllerCode
public function access() {
$config = $this
->config('social_media.settings');
if ($config
->get('social_media.email.enable') && $config
->get('social_media.email.enable_forward')) {
return AccessResult::allowed()
->addCacheableDependency($config);
}
return AccessResult::forbidden()
->addCacheableDependency($config);
}