You are here

function jammer_matchRoles in Jammer 1.0.x

1 call to jammer_matchRoles()
jammer_form_alter in ./jammer.module

File

./jammer.module, line 21
General functions and hook implementations.

Code

function jammer_matchRoles($roles, $entry) {
  $inList = FALSE;
  foreach ($roles as $role) {
    if (in_array($role, $entry['roles'])) {
      $inList = TRUE;
      break;
    }
  }

  // return depending on 'invert' field
  if ($entry['invert']) {
    return !$inList;
  }
  else {
    return $inList;
  }
}