Skip to content

Commit b694cf6

Browse files
committed
Remove link to "unauthorized" page in breadcrumb
fixes CNVS-5725 test plan: - login as any role with admin privileges - click on grades from the top navigation - click on name in breadcrumb - taken to /users/# - login as any role without admin privileges - click on grades from the top navigation - name in breadcrumb no longer has a link Change-Id: If2495ce21371cf7b0ef468764866217567228dc7 Reviewed-on: https://gerrit.instructure.com/55526 Tested-by: Jenkins Reviewed-by: Mark Severson <markse@instructure.com> QA-Review: Steven Shepherd <sshepherd@instructure.com> Product-Review: Andraia Allsop <aallsop@instructure.com>
1 parent 6a1934e commit b694cf6

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

app/controllers/users_controller.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ def grades
165165
@user = User.where(id: params[:user_id]).first if params[:user_id].present?
166166
@user ||= @current_user
167167
if authorized_action(@user, @current_user, :read)
168+
crumb_url = polymorphic_url([@current_user]) if @user.grants_right?(@current_user, session, :view_statistics)
169+
add_crumb(@current_user.short_name, crumb_url)
170+
add_crumb(t('crumbs.grades', 'Grades'), grades_path)
171+
168172
current_active_enrollments = @user.enrollments.current.includes(:course).shard(@user).to_a
169173

170174
@presenter = GradesPresenter.new(current_active_enrollments)

app/views/users/grades.html.erb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
<%
1+
<%
22
content_for :page_title, join_title(t(:page_title, "Grades"), @current_user.name)
3-
add_crumb(@current_user.short_name, context_url(@current_user, :context_url))
4-
add_crumb(t('crumbs.grades', 'Grades'), grades_path)
53
jammit_css :user_grades
64
%>
75

0 commit comments

Comments
 (0)