diff options
author | Kali Kaneko <kali@leap.se> | 2013-05-30 04:35:35 +0900 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2013-05-30 04:35:35 +0900 |
commit | 51032d827b297e4ea0cd529d57d73cd44e0c3905 (patch) | |
tree | cc69775b399af33479bcf1e3a7dbaa68b932b8b0 /doc/includes/sqlite3/authorizer.py | |
parent | 06d9e5e7714562b10c48a0482dec2acd4abee55a (diff) |
cleanup docs
Diffstat (limited to 'doc/includes/sqlite3/authorizer.py')
-rw-r--r-- | doc/includes/sqlite3/authorizer.py | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/doc/includes/sqlite3/authorizer.py b/doc/includes/sqlite3/authorizer.py deleted file mode 100644 index 0176c6c..0000000 --- a/doc/includes/sqlite3/authorizer.py +++ /dev/null @@ -1,26 +0,0 @@ -from pysqlite2 import dbapi2 as sqlite3 - -def authorizer_callback(action, arg1, arg2, dbname, source): - if action != sqlite3.SQLITE_SELECT: - return sqlite3.SQLITE_DENY - if arg1 == "private_table": - return sqlite3.SQLITE_DENY - return sqlite3.SQLITE_OK - -con = sqlite3.connect(":memory:") -con.executescript(""" - create table public_table(c1, c2); - create table private_table(c1, c2); - """) -con.set_authorizer(authorizer_callback) - -try: - con.execute("select * from private_table") -except sqlite3.DatabaseError, e: - print "SELECT FROM private_table =>", e.args[0] # access ... prohibited - -try: - con.execute("insert into public_table(c1, c2) values (1, 2)") -except sqlite3.DatabaseError, e: - print "DML command =>", e.args[0] # access ... prohibited - |