function check_permissions() { if (user_permissions_get("projects_view")) { // accept user if they have access to all staff if (user_permissions_get("timekeeping_all_view")) { return 1; } // select the IDs that the user does have access to if ($this->access_staff_ids = user_permissions_staff_getarray("timereg_view")) { return 1; } else { log_render("error", "page", "Before you can view project hours, your administrator must configure the staff accounts you may access, or set the timekeeping_all_view permission."); } } }
function check_permissions() { if (user_permissions_get("timekeeping")) { // check if user has permissions to write as the selected employee if ($this->employeeid) { if (!user_permissions_staff_get("timereg_write", $this->employeeid)) { log_write("error", "page_output", "Sorry, you do not have permissions to adjust the timesheet for the selected employee"); return 0; } } // accept user if they have write access to all staff if (user_permissions_get("timekeeping_all_write")) { return 1; } // select the IDs that the user does have write access to if ($this->access_staff_ids_write = user_permissions_staff_getarray("timereg_write")) { return 1; } else { log_render("error", "page", "Before you can add or edit timesheet hours, your administrator must configure the staff accounts you may access, or set the timekeeping_all_write permission."); } } }