code: def task_is_visible_by_user(self, task, username=None, lti=None):
          
          if username is None:
              username = self.session_username()
  
          return (self.course_is_open_to_user(task.get_course(), username, lti) and task.get_accessible_time().after_start()) or \
                 self.has_staff_rights_on_course(task.get_course(), username)
docs: Returns true if the task is visible by the user
          :param lti: indicates if the user is currently in a LTI session or not.
              - None to ignore the check
              - True to indicate the user is in a LTI session
              - False to indicate the user is not in a LTI session
              - "auto" to enable the check and take the information from the current session