[MLton-commit] r5234

Wesley Terpstra wesley at mlton.org
Sat Feb 17 08:22:28 PST 2007


test the authorizer
----------------------------------------------------------------------

U   mltonlib/trunk/ca/terpstra/sqlite3/demo.sml

----------------------------------------------------------------------

Modified: mltonlib/trunk/ca/terpstra/sqlite3/demo.sml
===================================================================
--- mltonlib/trunk/ca/terpstra/sqlite3/demo.sml	2007-02-17 16:13:04 UTC (rev 5233)
+++ mltonlib/trunk/ca/terpstra/sqlite3/demo.sml	2007-02-17 16:22:28 UTC (rev 5234)
@@ -35,6 +35,15 @@
            handle SQL.Error x => die x
 end
 
+local
+   open SQL.SQLite
+   fun auth (INSERT { table, db }) = 
+          (print (db ^ ":" ^ table ^ ": insert denied\n"); DENY)
+     | auth _ = ALLOW
+in
+   val () = setAuthorizer (db, SOME auth)
+end
+
 fun dumpP (s & i) = print (s ^ " " ^ Int.toString i ^ "\n")
 fun dumpV v = (Vector.app (fn s => print (s ^ " ")) v; print "\n")
 




More information about the MLton-commit mailing list