public function LdapAuthorizationConsumerAbstract::authorizationGrant in Lightweight Directory Access Protocol (LDAP) 7.2
Same name and namespace in other branches
- 8.2 ldap_authorization/LdapAuthorizationConsumerAbstract.class.php \LdapAuthorizationConsumerAbstract::authorizationGrant()
- 7 ldap_authorization/LdapAuthorizationConsumerAbstract.class.php \LdapAuthorizationConsumerAbstract::authorizationGrant()
Grant authorizations to a user.
Parameters
object $user: drupal user object.
array $consumers: in form of LdapAuthorizationConsumerAbstractClass::populateConsumersFromConsumerIds.
array $ldap_entry: is ldap data from ldap entry which drupal user is mapped to.
bool $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 233 - 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
Code
public function authorizationGrant(&$user, &$user_auth_data, $consumers, $ldap_entry = NULL, $user_save = TRUE) {
$this
->filterOffPastAuthorizationRecords($user, $user_auth_data);
$this
->grantsAndRevokes('grant', $user, $user_auth_data, $consumers, $ldap_entry, $user_save);
}