summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2011-03-09 16:32:59 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2011-03-09 16:32:59 -0500
commit0b5201816380c944b6872875c408f442219ac586 (patch)
tree0297576cdca5c9c4dd64c74a66930c80084fdd7f
parenta0dcc139a690661bf65d4b82aedee2c1975eb2dd (diff)
downloadGradeBook-0b5201816380c944b6872875c408f442219ac586.tar.gz
GradeBook-0b5201816380c944b6872875c408f442219ac586.zip
added dropped user group and defaults for it
Ignore-this: 49844ffc59906980dadc0c6f15a1cb30 darcs-hash:20110309213259-067c0-724b4a3c14aa65422b0b4cb5960faf776db5d1f1.gz
-rwxr-xr-xGradeBook_lib.tcl71
1 files changed, 37 insertions, 34 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl
index e71794e..60a34b6 100755
--- a/GradeBook_lib.tcl
+++ b/GradeBook_lib.tcl
@@ -282,8 +282,8 @@ proc CreateGradesTable {db} {
#UpdateColValue4GroupNameNonWeb UserHiddenColums instructor $instructor_hidden_columns
}
-proc AddAccessRightNonWeb { action instructor_right ta_right student_right guest_right } {
- set eval_str [concat INSERT INTO AccessRightsTable (actionname, instructor, ta, student, guest) VALUES('$action', '$instructor_right', '$ta_right', '$student_right', '$guest_right')]
+proc AddAccessRightNonWeb { action instructor_right ta_right student_right dropped_student_right guest_right } {
+ set eval_str [concat INSERT INTO AccessRightsTable (actionname, instructor, ta, student, dropped, guest) VALUES('$action', '$instructor_right', '$ta_right', '$student_right', '$dropped_student_right', '$guest_right')]
set err [catch {db eval $eval_str } errStat]
if { $err } {
htmlErrorMsg $errStat
@@ -292,43 +292,43 @@ proc AddAccessRightNonWeb { action instructor_right ta_right student_right guest
}
proc CreateAccessRightsTable {db} {
- set err [catch {db eval {CREATE TABLE AccessRightsTable(actionname text, instructor integer, ta integer, student integer, guest integer)} } errStat]
+ set err [catch {db eval {CREATE TABLE AccessRightsTable(actionname text, instructor integer, ta integer, student integer, dropped integer, guest integer)} } errStat]
if { $err } {
htmlErrorMsg $errStat
dbg "the following error happen: $errStat" 1
}
# guest should have no rights make sure that 0 is evereywhere except logon
- # actionname instructor ta student guest
- AddAccessRightNonWeb logon 1 1 1 1
- AddAccessRightNonWeb showgrades 1 1 1 0
- AddAccessRightNonWeb sort 1 1 0 0
- AddAccessRightNonWeb addcolumnrequest 1 1 0 0
- AddAccessRightNonWeb addcolumn 1 1 0 0
- AddAccessRightNonWeb deletecolumn 1 1 0 0
- AddAccessRightNonWeb showcontrols 1 1 1 0
- AddAccessRightNonWeb changegrades 1 1 0 0
- AddAccessRightNonWeb updategrades 1 1 0 0
- AddAccessRightNonWeb changecolumn 1 1 0 0
- AddAccessRightNonWeb updatecolumn 1 1 0 0
- AddAccessRightNonWeb logoff 1 1 1 0
- AddAccessRightNonWeb changefirstname 1 0 0 0
- AddAccessRightNonWeb changelastname 1 0 0 0
- AddAccessRightNonWeb changeusername 1 0 0 0
- AddAccessRightNonWeb userhidecolumn 1 1 1 0
- AddAccessRightNonWeb userunhidecolumn 1 1 1 0
- AddAccessRightNonWeb userhidegroup 1 0 0 0
- AddAccessRightNonWeb userunhidegroup 1 0 0 0
- AddAccessRightNonWeb userhidegradecategory 1 0 0 0
- AddAccessRightNonWeb userunhidegradecategory 1 0 0 0
- AddAccessRightNonWeb editcourseinfo 1 0 0 0
- AddAccessRightNonWeb updatecourseinfo 1 0 0 0
- AddAccessRightNonWeb editnewuserinfo 1 0 0 0
- AddAccessRightNonWeb addnewuserinfo 1 0 0 0
- AddAccessRightNonWeb choosenewpassword 1 1 1 0
- AddAccessRightNonWeb setnewpassword 1 1 1 0
- AddAccessRightNonWeb changegroupname 1 0 0 0
- AddAccessRightNonWeb setgroupname 1 0 0 0
- AddAccessRightNonWeb resetforgottenpassword 0 0 0 1
+ # actionname instructor ta student dropped guest
+ AddAccessRightNonWeb logon 1 1 1 1 1
+ AddAccessRightNonWeb showgrades 1 1 1 1 0
+ AddAccessRightNonWeb sort 1 1 0 0 0
+ AddAccessRightNonWeb addcolumnrequest 1 1 0 0 0
+ AddAccessRightNonWeb addcolumn 1 1 0 0 0
+ AddAccessRightNonWeb deletecolumn 1 1 0 0 0
+ AddAccessRightNonWeb showcontrols 1 1 1 1 0
+ AddAccessRightNonWeb changegrades 1 1 0 0 0
+ AddAccessRightNonWeb updategrades 1 1 0 0 0
+ AddAccessRightNonWeb changecolumn 1 1 0 0 0
+ AddAccessRightNonWeb updatecolumn 1 1 0 0 0
+ AddAccessRightNonWeb logoff 1 1 1 1 0
+ AddAccessRightNonWeb changefirstname 1 0 0 0 0
+ AddAccessRightNonWeb changelastname 1 0 0 0 0
+ AddAccessRightNonWeb changeusername 1 0 0 0 0
+ AddAccessRightNonWeb userhidecolumn 1 1 1 1 0
+ AddAccessRightNonWeb userunhidecolumn 1 1 1 1 0
+ AddAccessRightNonWeb userhidegroup 1 0 0 0 0
+ AddAccessRightNonWeb userunhidegroup 1 0 0 0 0
+ AddAccessRightNonWeb userhidegradecategory 1 0 0 0 0
+ AddAccessRightNonWeb userunhidegradecategory 1 0 0 0 0
+ AddAccessRightNonWeb editcourseinfo 1 0 0 0 0
+ AddAccessRightNonWeb updatecourseinfo 1 0 0 0 0
+ AddAccessRightNonWeb editnewuserinfo 1 0 0 0 0
+ AddAccessRightNonWeb addnewuserinfo 1 0 0 0 0
+ AddAccessRightNonWeb choosenewpassword 1 1 1 1 0
+ AddAccessRightNonWeb setnewpassword 1 1 1 1 0
+ AddAccessRightNonWeb changegroupname 1 0 0 0 0
+ AddAccessRightNonWeb setgroupname 1 0 0 0 0
+ AddAccessRightNonWeb resetforgottenpassword 0 0 0 0 1
}
proc htmlErrorMsg { msg } {
@@ -377,6 +377,7 @@ proc htmlDBout {db permission_list user {sort_col {}}} {
instructor { set hidden_columns {} }
ta { set hidden_columns [list UserName PasswordHash GroupName UserHiddenColums UserHiddenGroups UserHiddenGradeCategories IdNum] }
student { set hidden_columns [list FirstName LastName UserName PasswordHash GroupName UserHiddenColums UserHiddenGroups UserHiddenGradeCategories IdNum SectionNum] }
+ dropped { set hidden_columns [list FirstName LastName UserName PasswordHash GroupName UserHiddenColums UserHiddenGroups UserHiddenGradeCategories IdNum SectionNum] }
guest { set hidden_columns $column_list }
default { set hidden_columns $column_list }
}
@@ -418,6 +419,7 @@ proc htmlDBout {db permission_list user {sort_col {}}} {
}
ta { set where_statement "WHERE GroupName=\"student\"" }
student { set where_statement "WHERE UserName=\"$user\"" }
+ dropped { set where_statement "WHERE UserName=\"$user\"" }
guest { dbg "Guest must not be allowed to set table view port. Aborting. This line is never executed" 0; exit }
default { dbg "Default must not be allowed to set table view port. Aborting. This line is never executed." 0; exit }
}
@@ -1389,6 +1391,7 @@ proc htmlGradesTable {db permission_list user} {
switch $permission(GroupName) {
guest { }
student { htmlDBout db $permission_list $user $sortCol}
+ dropped { htmlDBout db $permission_list $user $sortCol}
ta { htmlDBout db $permission_list $user $sortCol}
instructor { htmlDBout db $permission_list $user $sortCol}
default { }