function calendar_access_can_cancel_appointment

7.x calendar.module calendar_access_can_cancel_appointment($cid)
6.x calendar.module calendar_access_can_cancel_appointment($cid)

Make sure the user is allowed to cancel this appointment.

Used by the hook_menu item

1 string reference to 'calendar_access_can_cancel_appointment'
calendar_menu in modules/calendar/calendar.module
implements hook_menu

File

modules/calendar/calendar.module, line 414

Code

function calendar_access_can_cancel_appointment($cid) {
  global $user;
  $content = content_load($cid);

  if (user_has_permission("can_cancel_own_appointments")) {
    if ($user->cwid == $content->field__student_id ['value'] || $user->cwid == $content->field__faculty_id ['value'] || $user->id == 1) {
      return TRUE;
    }
  }

  return FALSE;

}