You are here

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

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

NOTE this is in mixed case, since we must rely on whatever module is storing the authorization id.

Parameters

drupal user object $user:

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

Return value

param boolean is user has authorization id, regardless of what module granted it.

1 method overrides LdapAuthorizationConsumerAbstract::hasAuthorization()
LdapAuthorizationConsumerOG::hasAuthorization in ldap_authorization/ldap_authorization_og/LdapAuthorizationConsumerOG.class.php
NOTE this is in mixed case, since we must rely on whatever module is storing the authorization id.

File

ldap_authorization/LdapAuthorizationConsumerAbstract.class.php, line 525
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 hasAuthorization(&$user, $consumer_id) {
  return @in_array($consumer_id, $this
    ->usersAuthorizations($user));
}