Changeset 207:05a4873e7cc8
- Timestamp:
- 06/13/06 19:23:36 (2 years ago)
- Author:
- gh
- Tags:
- 2.3.0
- Message:
-
Documentation for the set_authorizer API.
- Location:
- doc
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r200
|
r207
|
|
| 6 | 6 | | (c) 2005-2006 Gerhard Häring |
| 7 | 7 | |
| 8 | | Last updated for pysqlite 2.2.1 |
| | 8 | Last updated for pysqlite 2.3.0 |
| 9 | 9 | |
| 10 | 10 | Table Of Contents |
| … |
… |
|
| 26 | 26 | | `3.4 Checking for complete statements`_ |
| 27 | 27 | | `3.5 Enabling SQLite's shared cache`_ |
| | 28 | | `3.6 Setting an authorizer callback`_ |
| 28 | 29 | | `4. SQLite and Python types`_ |
| 29 | 30 | | `4.1 Introduction`_ |
| … |
… |
|
| 670 | 671 | :source-file: code/shared_cache.py |
| 671 | 672 | |
| | 673 | 3.6 Setting an authorizer callback |
| | 674 | ---------------------------------- |
| | 675 | |
| | 676 | You can set an authorizer callback if you want to restrict what your users can |
| | 677 | do with the database. This is mostly useful if you accept arbitrary SQL from |
| | 678 | users and want to execute it safely. See the relevant section in the SQL |
| | 679 | documentation for details: |
| | 680 | http://sqlite.org/capi3ref.html#sqlite3_set_authorizer |
| | 681 | |
| | 682 | All necessary constants like SQLITE_OK, SQLITE_DENY, SQLITE_IGNORE, |
| | 683 | SQLITE_SELECT, SQLITE_CREATE_INDEX and all other authorizer-related constants |
| | 684 | are available through the dbapi2 module. |
| | 685 | |
| | 686 | Here's an example that demonstrates the usage of this function: |
| | 687 | |
| | 688 | .. code-block:: |
| | 689 | :language: Python |
| | 690 | :source-file: code/authorizer.py |
| | 691 | |
| | 692 | |
| 672 | 693 | 4. SQLite and Python types |
| 673 | 694 | ========================== |