You are here

class MandrillMailerAccessCheck in Mandrill 8

Checks access for displaying configuration page.

Hierarchy

Expanded class hierarchy of MandrillMailerAccessCheck

1 string reference to 'MandrillMailerAccessCheck'
mandrill.services.yml in ./mandrill.services.yml
mandrill.services.yml
1 service uses MandrillMailerAccessCheck
access_check.mandrill.mailer in ./mandrill.services.yml
Drupal\mandrill\Access\MandrillMailerAccessCheck

File

src/Access/MandrillMailerAccessCheck.php, line 11

Namespace

Drupal\mandrill\Access
View 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

Namesort descending Modifiers Type Description Overrides
MandrillMailerAccessCheck::access public function Access check for Mandrill module configuration.