class MandrillMailerAccessCheck in Mandrill 8
Checks access for displaying configuration page.
Hierarchy
- class \Drupal\mandrill\Access\MandrillMailerAccessCheck implements AccessInterface
Expanded class hierarchy of MandrillMailerAccessCheck
1 string reference to 'MandrillMailerAccessCheck'
1 service uses MandrillMailerAccessCheck
File
- src/
Access/ MandrillMailerAccessCheck.php, line 11
Namespace
Drupal\mandrill\AccessView source
class MandrillMailerAccessCheck implements AccessInterface {
/**
* Access check for Mandrill module configuration.
*
* Ensures a Mandrill API key has been provided.
*
* @return \Drupal\Core\Access\AccessResultInterface
* The access result.
*/
public function access() {
$sender = \Drupal::config('mailsystem.settings')
->get('defaults')['sender'];
return AccessResult::allowedIf(in_array($sender, [
'mandrill_mail',
'mandrill_test_mail',
]));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MandrillMailerAccessCheck:: |
public | function | Access check for Mandrill module configuration. |