You are here

public function LdapAuthorizationConsumerAbstract::authorizationGrant in Lightweight Directory Access Protocol (LDAP) 7

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

grant authorizations to a user

Parameters

object $user drupal user object:

$consumer_ids string or array of strings that are authorization consumer ids:

array $ldap_entry is ldap data from ldap entry which drupal user is mapped to:

boolean $user_save. should user object be saved by authorizationGrant method:

Return value

array $results. Array of form array( <authz consumer id1> => 1, <authz consumer id2> => 0, ) where 1s and 0s represent success and failure to grant

method may be desireable to override, if consumer benefits from adding grants as a group rather than one at a time

File

ldap_authorization/LdapAuthorizationConsumerAbstract.class.php, line 163
abstract class to represent an ldap_authorization consumer 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
@file abstract class to represent an ldap_authorization consumer such as drupal_role, og_group, etc. each authorization comsumer will extend this class with its own class named LdapAuthorizationConsumer<consumer type> such as…

Code

public function authorizationGrant(&$user, &$user_auth_data, $consumer_ids, $ldap_entry = NULL, $user_save = TRUE) {
  $this
    ->grantsAndRevokes('grant', $user, $user_auth_data, $consumer_ids, $ldap_entry, $user_save);
}