You are here

public function LdapAuthorizationConsumerAbstract::hasLdapGrantedAuthorization in Lightweight Directory Access Protocol (LDAP) 7.2

Same name and namespace in other branches
  1. 8.2 ldap_authorization/LdapAuthorizationConsumerAbstract.class.php \LdapAuthorizationConsumerAbstract::hasLdapGrantedAuthorization()
  2. 7 ldap_authorization/LdapAuthorizationConsumerAbstract.class.php \LdapAuthorizationConsumerAbstract::hasLdapGrantedAuthorization()

Parameters

drupal user object $user:

string lowercase $consumer_id: such as drupal role name, og group name, etc.

Return value

boolean if an ldap_authorization_* module granted the authorization id

File

ldap_authorization/LdapAuthorizationConsumerAbstract.class.php, line 511
Abstract class to represent an ldap_authorization consumer behavior such as drupal_role, og_group, etc. each authorization comsumer will extend this class with its own class named LdapAuthorizationConsumer<consumer type> such as…

Class

LdapAuthorizationConsumerAbstract

Code

public function hasLdapGrantedAuthorization(&$user, $consumer_id) {
  return !empty($user->data['ldap_authorizations'][$this->consumerType][$consumer_id]);
}