You are here

function opigno_rules_user_has_roles in Opigno 7

File

./opigno.rules.inc, line 36

Code

function opigno_rules_user_has_roles($role, $group, $account) {
  $all_roles = og_get_user_roles('node', $group->nid, $account->uid, TRUE);
  foreach ($all_roles as $a_role => $a_rolename) {
    if ($role == $a_role) {
      return TRUE;
    }
  }
  return FALSE;
}