summaryrefslogtreecommitdiff
path: root/GradeBook.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'GradeBook.tcl')
-rwxr-xr-xGradeBook.tcl13
1 files changed, 6 insertions, 7 deletions
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 {<br>}
foreach {act act_label} $action_list {
- if { [info exist permission($act) ] } {
- if { $permission($act) } {
- puts -nonewline "$separator<a href=$script_name?action=$act&columnname=[::ncgi::encode $col]>$act_label</a>"
- }
+ if { [isActionGranted $act $permission_list $user] } {
+ puts -nonewline "$separator<a href=$script_name?action=$act&columnname=[::ncgi::encode $col]>$act_label</a>"
}
}
puts -nonewline "</th>"
+ puts ""
}
puts "</tr>"
puts "<tr>"
@@ -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 { }
}
}