aboutsummaryrefslogtreecommitdiff
path: root/GradeBook.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'GradeBook.tcl')
-rwxr-xr-xGradeBook.tcl40
1 files changed, 23 insertions, 17 deletions
diff --git a/GradeBook.tcl b/GradeBook.tcl
index 622704a..90207a7 100755
--- a/GradeBook.tcl
+++ b/GradeBook.tcl
@@ -90,23 +90,29 @@ proc AddAccessRightNonWeb { action instructor_right ta_right student_right guest
}
proc CreateAccessRightsTable {db} {
- db eval {CREATE TABLE AccessRightsTable(actionname text, instructor integer, ta integer, student integer, guest integer)}
- # guest should have no rights make sure that 0 is evereywhere
- db eval {INSERT INTO AccessRightsTable VALUES('logon', 1, 1, 1, 1)}
- db eval {INSERT INTO AccessRightsTable VALUES('showgrades', 1, 1, 1, 0)}
- db eval {INSERT INTO AccessRightsTable VALUES('sort', 1, 1, 0, 0)}
- db eval {INSERT INTO AccessRightsTable VALUES('addcolumnrequest', 1, 1, 0, 0)}
- db eval {INSERT INTO AccessRightsTable VALUES('addcolumn', 1, 1, 0, 0)}
- db eval {INSERT INTO AccessRightsTable VALUES('deletecolumn', 1, 1, 0, 0)}
- db eval {INSERT INTO AccessRightsTable VALUES('showcontrols', 1, 1, 1, 0)}
- db eval {INSERT INTO AccessRightsTable VALUES('changegrades', 1, 1, 0, 0)}
- db eval {INSERT INTO AccessRightsTable VALUES('updategrades', 1, 1, 0, 0)}
- db eval {INSERT INTO AccessRightsTable VALUES('changecolumn', 1, 1, 0, 0)}
- db eval {INSERT INTO AccessRightsTable VALUES('updatecolumn', 1, 1, 0, 0)}
- db eval {INSERT INTO AccessRightsTable VALUES('logoff', 1, 1, 1, 0)}
- db eval {INSERT INTO AccessRightsTable VALUES('changefirstname', 1, 0, 0, 0)}
- db eval {INSERT INTO AccessRightsTable VALUES('changelastname', 1, 0, 0, 0)}
- db eval {INSERT INTO AccessRightsTable VALUES('changeusername', 1, 0, 0, 0)}
+ set err [catch {db eval {CREATE TABLE AccessRightsTable(actionname text, instructor integer, ta integer, student 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 hidecolumn 1 1 1 0
}
proc htmlErrorMsg { msg } {