function _agreement_user_has_role in Agreement 7.2
Checks if user has agreement roles.
Parameters
object $account: The user account.
array $role_ids: The role ids to check.
Return value
bool TRUE if the user's roles intersect with the provided role ids.
2 calls to _agreement_user_has_role()
- agreement_form in ./
agreement.pages.inc - FAPI definition for the agreement form.
- agreement_type_get_best_match in ./
agreement.module - Get the best match agreement type for a user and path.
File
- ./
agreement.module, line 606 - Agreement module code - agreement.module.
Code
function _agreement_user_has_role($account, $role_ids) {
$account_roles = array_keys($account->roles);
return !empty(array_intersect($role_ids, $account_roles));
}