From bbe72022bf5514ca5fb5620b748455a64aa41cc1 Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Wed, 19 Jan 2011 21:23:45 -0500 Subject: actions in default ta and instructor view are simplified Ignore-this: 777bc5d2d49c63a3f895294e1ae1fb14 darcs-hash:20110120022345-067c0-88a7336a8c9e61928fe2ed68ddd7731193a8f85c.gz --- GradeBook.tcl | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'GradeBook.tcl') diff --git a/GradeBook.tcl b/GradeBook.tcl index 5934399..18c194d 100755 --- a/GradeBook.tcl +++ b/GradeBook.tcl @@ -102,7 +102,7 @@ proc htmlReplaceEmptyString { string } { set string } -proc htmlDBout {db permission_list {sort_col {}}} { +proc htmlDBout {db permission_list user {sort_col {}}} { array set permission $permission_list global script_name set defSortCol LastName @@ -135,13 +135,12 @@ proc htmlDBout {db permission_list {sort_col {}}} { set action_list [list changegrades "change grades" deletecolumn delete renamecolumn rename changecolumn "change column"] set separator {
} foreach {act act_label} $action_list { - if { [info exist permission($act) ] } { - if { $permission($act) } { - puts -nonewline "$separator$act_label" - } + if { [isActionGranted $act $permission_list $user] } { + puts -nonewline "$separator$act_label" } } puts -nonewline "" + puts "" } puts "" puts "" @@ -668,8 +667,8 @@ proc htmlGradesTable {db permission_list user} { switch $permission(GroupName) { guest { } student { htmlStudentGrades db $user} - ta { htmlDBout db $permission_list $sortCol} - instructor { htmlDBout db $permission_list $sortCol} + ta { htmlDBout db $permission_list $user $sortCol} + instructor { htmlDBout db $permission_list $user $sortCol} default { } } } -- cgit v1.2.3