def _can_view_courseware_with_prerequisites(user, course):
 def _is_prerequisites_disabled():
  '\n        Checks if prerequisites are disabled in the settings.\n        '
  return (ACCESS_DENIED if is_prerequisite_courses_enabled() else ACCESS_GRANTED)
 return (_is_prerequisites_disabled() or _has_staff_access_to_descriptor(user, course, course.id) or user.is_anonymous() or _has_fulfilled_prerequisites(user, [course.id]))

def _can_view_courseware_with_prerequisites ( user , course ) : def _is_prerequisites_disabled ( ) : return ( ACCESS_DENIED if is_prerequisite_courses_enabled ( ) else ACCESS_GRANTED ) return ( _is_prerequisites_disabled ( ) or _has_staff_access_to_descriptor ( user , course , course . id ) or user . is_anonymous ( ) or _has_fulfilled_prerequisites ( user , [ course . id ] ) )
checks if a user has access to a course based on its prerequisites .