function ldap_authorization_og1_has_role in Lightweight Directory Access Protocol (LDAP) 7
Same name and namespace in other branches
- 8.2 ldap_authorization/ldap_authorization_og/ldap_authorization_og.module \ldap_authorization_og1_has_role()
Test if a user has a particular group role
Parameters
int $gid as og group id:
int $uid as user id:
string $role_name as og role name:
Return value
boolean signifying if user has group x role
File
- ldap_authorization/
ldap_authorization_og/ ldap_authorization_og.module, line 169 - controls organic group membership based on LDAP values
Code
function ldap_authorization_og1_has_role($gid, $uid, $role_name) {
$rid = ldap_authorization_og_rid_from_role_name($role_name);
$roles = og_get_user_roles($gid, $uid);
return is_array($roles) && isset($roles[$rid]);
}