diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-01-22 23:11:07 -0500 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-01-22 23:11:07 -0500 |
commit | 9051d3a5f3dcb4a9cd995e772ed4e5377088e3f2 (patch) | |
tree | f7c930b0b4567599243f2d9699adb61c10229206 | |
parent | b86b6ecb8824e41cf5d901b21a6d7d03b37632a3 (diff) | |
download | GradeBook-9051d3a5f3dcb4a9cd995e772ed4e5377088e3f2.tar.gz GradeBook-9051d3a5f3dcb4a9cd995e772ed4e5377088e3f2.zip |
proper check of permissions for hide unhide groups
Ignore-this: 4d02243a67f9a5cb5b6d543d7913a138
darcs-hash:20110123041107-067c0-db68de5af08458fa87466080ef0ca635a43bf1fc.gz
-rwxr-xr-x | GradeBook.tcl | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/GradeBook.tcl b/GradeBook.tcl index 168902c..d212f34 100755 --- a/GradeBook.tcl +++ b/GradeBook.tcl @@ -763,18 +763,22 @@ proc ShowControls { permission_list user } { set user_groups_for_hide [removeElementFromList $grp $user_groups_for_hide] } # output group to hide offering - if { $user_groups_for_hide ne "" } { - puts "<br>" - puts "HideGroup: " - foreach grp $user_groups_for_hide { - puts "<span class=\"controls\"><a href=\"$script_name?action=userhidegroup&groupname=[::ncgi::encode $grp]\">$grp</a></span>" + if { [isActionGranted userhidegroup $permission_list $user] } { + if { $user_groups_for_hide ne "" } { + puts "<br>" + puts "HideGroup: " + foreach grp $user_groups_for_hide { + puts "<span class=\"controls\"><a href=\"$script_name?action=userhidegroup&groupname=[::ncgi::encode $grp]\">$grp</a></span>" + } } } - if { $currently_hidden_groups ne "" } { - puts "<br>" - puts {Unhide groups: } - foreach grp $currently_hidden_groups { - puts "<span class=\"controls\"><a href=\"$script_name?action=userunhidegroup&groupname=[::ncgi::encode $grp]\">$grp</a></span>" + if { [isActionGranted userunhidegroup $permission_list $user] } { + if { $currently_hidden_groups ne "" } { + puts "<br>" + puts {Unhide groups: } + foreach grp $currently_hidden_groups { + puts "<span class=\"controls\"><a href=\"$script_name?action=userunhidegroup&groupname=[::ncgi::encode $grp]\">$grp</a></span>" + } } } |