summaryrefslogtreecommitdiff
path: root/GradeBook.tcl
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2011-01-21 12:26:52 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2011-01-21 12:26:52 -0500
commitaf5300d4fd566cf78fba88ff948f7726e92b0f8b (patch)
tree75474a770167056f4e0f077858a76e1a3cf051db /GradeBook.tcl
parent3a31d5a2fced838a1ffd08f2999431d3fde0ead9 (diff)
downloadGradeBook-af5300d4fd566cf78fba88ff948f7726e92b0f8b.tar.gz
GradeBook-af5300d4fd566cf78fba88ff948f7726e92b0f8b.zip
using AddAccessRightNonWeb for table creation of AccessRights table
Ignore-this: 1ade5426dcf3d4439b303379806b1914 darcs-hash:20110121172652-067c0-25033fd63c368df70756db00a7ec89c8a9df3f37.gz
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 } {