The web.auth.setup() function has the following parameters and returns an AuthAdmin object:
storage[,cursor=None][,dir=None][,table='Auth']) |
Warning:
Because more options may be specified in future versions of this function you should not rely on the order of these parameters. Instead they should be specified with the parameter name and an =
sign as is used in the examples in this documentation.
'database'
or 'file'
.
If storage is 'database'
you must also specify cursor to be a valid web.database cursor. By default the necessary database tables beign with 'Auth'
. If you want them to begin with something else, perhaps if you want two lots of auth storage in the same database, you can specify the table prepend string using table. For example table='Auth2'
would create the tables Auth2Level
, Auth2User
and Auth2App
.
If storage is 'file'
you must also specify a directory dir which allows read and write access where the auth information is stored.
The AuthAdminFile
object returned by the setup() function when storage='file'
has the following methods and attributes:
) |
app) |
True
if there is an application named app, False
otherwise.
app) |
app) |
) |
username) |
True
if there is a user with the username username, False
otherwise.
username, password[,firstname=''][,surname=''][email='']) |
username) |
username) |
username, value) |
username) |
username, value) |
username) |
username, value) |
username) |
username, value) |
) |
username, app) |
username, app, level) |
username) |
The AuthManagerDatabase
object returned by the setup() function when storage='database'
has the all the methods and attributes of the AuthAdminFile object as well as the following methods:
) |
) |
) |
) |
True
. If any are missing returns False
.
See About this document... for information on suggesting changes.