diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index ce15a2a003..27adf485f0 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -131,10 +131,14 @@ def dashboard(request): staff_access = True errored_courses = modulestore().get_errored_courses() + show_courseware_links_for = frozenset(course.id for course in courses + if has_access(request.user, course, 'load')) + context = {'courses': courses, 'message': message, 'staff_access': staff_access, - 'errored_courses': errored_courses,} + 'errored_courses': errored_courses, + 'show_courseware_links_for' : show_courseware_links_for} return render_to_response('dashboard.html', context) diff --git a/lms/djangoapps/courseware/views.py b/lms/djangoapps/courseware/views.py index 6122ebd333..71ec687cf6 100644 --- a/lms/djangoapps/courseware/views.py +++ b/lms/djangoapps/courseware/views.py @@ -264,7 +264,11 @@ def registered_for_course(course, user): def course_about(request, course_id): course = get_course_with_access(request.user, course_id, 'see_exists') registered = registered_for_course(course, request.user) - return render_to_response('portal/course_about.html', {'course': course, 'registered': registered}) + show_courseware_link = has_access(request.user, course, 'load') + return render_to_response('portal/course_about.html', + {'course': course, + 'registered': registered, + 'show_courseware_link' : show_courseware_link}) @ensure_csrf_cookie diff --git a/lms/templates/dashboard.html b/lms/templates/dashboard.html index 0f9c26611b..6be72277cc 100644 --- a/lms/templates/dashboard.html +++ b/lms/templates/dashboard.html @@ -87,7 +87,9 @@

Class Starts - ${course.start_date_text}

-

View Courseware

+ % if course.id in show_courseware_links_for: +

View Courseware

+ % endif diff --git a/lms/templates/portal/course_about.html b/lms/templates/portal/course_about.html index bff24d597a..d6c731431e 100644 --- a/lms/templates/portal/course_about.html +++ b/lms/templates/portal/course_about.html @@ -74,7 +74,10 @@ %if show_link: %endif - You are registered for this course (${course.number}) View Courseware + You are registered for this course (${course.number}) + % if show_courseware_link: + View Courseware + % endif %if show_link: %endif