function audit_can_access_audit

7.x audit.module audit_can_access_audit($student_id = "")
6.x audit.module audit_can_access_audit($student_id = "")

Used by the menu to determine if the user can see the Audit tab at all.

Basically, have we selected a student? AND, do we have the correct permission?

2 calls to audit_can_access_audit()
audit_hidden_approval_form_submit in modules/audit/audit.module
comments_render_comment in modules/comments/comments.module
Display the comment array in a pretty way.

File

modules/audit/audit.module, line 783
This is the Audit module, which provides functionality relating to degree audits.

Code

function audit_can_access_audit($student_id = "") {
  global $current_student_id, $user;

  if ($student_id == "") {
    $student_id = $current_student_id;
  }

  // must be logged in first...
  if (!user_has_permission("access_logged_in_content")) {
    return FALSE;
  }


  if ($student_id != "") {
    // yes, a student has been selected.  Do we have permission to view audits for THIS student?
    if (user_has_permission("view_student_audits") && advise_can_access_view($student_id)) {
      return TRUE;
    }
  }

  return FALSE;

}