'add course if provided otherwise add courses in which the user is enrolled in'

def field_dictionary(self, **kwargs):

    field_dictionary = super(LmsSearchFilterGenerator, self).field_dictionary(**kwargs)
    if (not kwargs.get('user')):
        field_dictionary['course'] = []
    elif (not kwargs.get('course_id')):
        user_enrollments = self._enrollments_for_user(kwargs['user'])
        field_dictionary['course'] = [unicode(enrollment.course_id) for enrollment in user_enrollments]
    course_org_filter = configuration_helpers.get_current_site_orgs()
    if course_org_filter:
        field_dictionary['org'] = course_org_filter
    return field_dictionary
