roster: show activity columns based on "usage reports" permissions

fixes CNVS-13436

test plan:
  * for teachers, disable these permissions:
    * Add/remove other teachers, course designers or TAs to the course
    * Add/remove students for the course
  * enable View usage reports for the course
  * log in as a teacher
  * view the course roster
  * confirm that the activity columns are visible

Change-Id: Ida208431c5d94b5f6f3a7a2df2901e5c4300b3a0
Reviewed-on: https://gerrit.instructure.com/35891
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Anthus Williams <awilliams@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
This commit is contained in:
Braden Anderson 2014-06-04 11:36:13 -06:00
parent 46014b86d0
commit 9dc7c5974d
3 changed files with 4 additions and 3 deletions

View File

@ -200,7 +200,8 @@ class ContextController < ApplicationController
:permissions => {
:manage_students => (manage_students = @context.grants_right?(@current_user, session, :manage_students)),
:manage_admin_users => (manage_admins = @context.grants_right?(@current_user, session, :manage_admin_users)),
:add_users => manage_students || manage_admins
:add_users => manage_students || manage_admins,
:read_reports => @context.grants_right?(@current_user, session, :read_reports)
},
:course => {
:id => @context.id,

View File

@ -22,7 +22,7 @@
<div>{{enrollmentName role}}</div>
{{/each}}
</td>
{{#if canViewLoginIdColumn}}
{{#if ENV.permissions.read_reports}}
<td>
{{#each enrollments}}
<div {{contextSensitiveDatetimeTitle last_activity_at }}>

View File

@ -10,7 +10,7 @@
{{/if}}
<th>{{#t "section"}}Section{{/t}}</th>
<th>{{#t "role"}}Role{{/t}}</th>
{{#if canViewLoginIdColumn}}
{{#if ENV.permissions.read_reports}}
<th>{{#t "last_activity"}}Last Activity{{/t}}</th>
<th>{{#t "total_activity"}}Total Activity{{/t}}</th>
{{/if}}