diff options
Diffstat (limited to 'GradeBook.tcl')
-rwxr-xr-x | GradeBook.tcl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/GradeBook.tcl b/GradeBook.tcl index 18c194d..dfc3410 100755 --- a/GradeBook.tcl +++ b/GradeBook.tcl @@ -251,13 +251,19 @@ proc isActionGranted { action permission_list user } { array set permission $permission_list if { $action == "defaultview" } { # this one permitted to everyone + dbg "requested action $action for user $user is granted" 4 return 1; } - if { [info exist permission($action) ] && $permission($action) } { - dbg "requested action $action is granted" 4 + if { ![info exist permission($action) ] } { + dbg "requested UNKNOWN action $action for user $user is not granted" 0 + return 0; + } + + if {$permission($action) } { + dbg "requested action $action for user $user is granted" 4 return 1; } else { - dbg "requested action $action is not granted" 4 + dbg "requested action $action for user $user is not granted" 1 return 0; } } @@ -266,6 +272,7 @@ proc ChoseAction {action permission_list user} { array set permission $permission_list dbg "requested action: $action" 1 if { [isActionGranted $action $permission_list $user] } { + switch $action { sort { SetSortColumn; ChoseAction defaultview $permission_list $user } addcolumn { |