abuse_access

Definition

abuse_access()
abuse/abuse.module, line 41

Description

Implementation of access controls

Code

<?php
function abuse_access() {
  $args = func_num_args();
  if ($args < 1) {
    return user_access(ADMINISTER_ALL_ABUSE_REPORTS);
  }
  else {
    $perms = func_get_args();
    for ($i = 0; $i < $args; $i++) {
      // Because of the arguments, an array could be passed in
      if (is_array($perms[$i])) {
        foreach ($perms[$i] as $permission) {
          if (user_access($permission)) {
            return true;
          }
        }
      }
      else {
        if (user_access($perms[$i])) {
          return TRUE;
        }
      }
    }
  }
  return FALSE;
}
?>