You are here

public function UserHelpTabAccess::accessLdapHelpTab in Lightweight Directory Access Protocol (LDAP) 8.4

Same name and namespace in other branches
  1. 8.3 ldap_authentication/src/Access/UserHelpTabAccess.php \Drupal\ldap_authentication\Access\UserHelpTabAccess::accessLdapHelpTab()

Access callback for help tab.

Return value

bool Whether user is allowed to see tab or not.

1 call to UserHelpTabAccess::accessLdapHelpTab()
UserHelpTabAccess::access in ldap_authentication/src/Access/UserHelpTabAccess.php

File

ldap_authentication/src/Access/UserHelpTabAccess.php, line 64

Class

UserHelpTabAccess
Checks whether the use is allowed to see the help tab.

Namespace

Drupal\ldap_authentication\Access

Code

public function accessLdapHelpTab() : bool {
  $mode = $this->config
    ->get('authenticationMode');
  if ($mode === 'mixed') {
    if ($this->externalAuth
      ->get($this->currentUser
      ->id(), 'ldap_user')) {
      return TRUE;
    }
  }
  else {
    if ($this->currentUser
      ->isAnonymous() || $this->externalAuth
      ->get($this->currentUser
      ->id(), 'ldap_user')) {
      return TRUE;
    }
  }
  return FALSE;
}