public function is_allowed_to_edit() { if (Request::is_student_view()) { return false; } $session_id = Request::get_session_id(); if ($session_id != 0 && api_is_allowed_to_session_edit(false, true) == false) { return false; } if (!api_is_allowed_to_edit(false, true, true)) { return false; } return true; }
public function authorize() { $authorize = api_protect_course_script(); if (!$authorize) { return false; } $c_id = Request::get_c_id(); if (empty($c_id)) { return false; } if (Request::is_student_view()) { return false; } if (!$this->is_allowed_to_edit()) { return false; } return true; }