diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-01-19 21:23:45 -0500 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-01-19 21:23:45 -0500 |
commit | bbe72022bf5514ca5fb5620b748455a64aa41cc1 (patch) | |
tree | 83b91c468d18783d6039a2548b93eb8d2e3aced4 | |
parent | 555b7aa5a63aa631a963b4cb6196d41d650bc605 (diff) | |
download | GradeBook-bbe72022bf5514ca5fb5620b748455a64aa41cc1.tar.gz GradeBook-bbe72022bf5514ca5fb5620b748455a64aa41cc1.zip |
actions in default ta and instructor view are simplified
Ignore-this: 777bc5d2d49c63a3f895294e1ae1fb14
darcs-hash:20110120022345-067c0-88a7336a8c9e61928fe2ed68ddd7731193a8f85c.gz
-rwxr-xr-x | GradeBook.tcl | 13 |
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 { } } } |