'Cache all restricted courses and returns the dict of course_keys and disable_access_check that are restricted'

@classmethod
def _get_restricted_courses_from_cache(cls):

    restricted_courses = cache.get(cls.COURSE_LIST_CACHE_KEY)
    if (restricted_courses is None):
        restricted_courses = {unicode(course.course_key): {'disable_access_check': course.disable_access_check} for course in RestrictedCourse.objects.all()}
        cache.set(cls.COURSE_LIST_CACHE_KEY, restricted_courses)
    return restricted_courses
