|
url(self,
f=None,
args=None,
vars=None,
scheme=False) |
source code
|
|
|
|
|
__init__(self,
environment=None,
db=None,
mailer=True,
hmac_key=None,
controller=' default ' ,
function=' user ' ,
cas_provider=None,
signature=True,
secure=False,
csrf_prevention=True,
propagate_extension=None)
auth=Auth(db) |
source code
|
|
|
|
|
_get_user_id(self)
accessor for auth.user_id |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_HTTP(self,
*a,
**b)
only used in lambda: self._HTTP(404) |
source code
|
|
|
|
|
navbar(self,
prefix=' Welcome ' ,
action=None,
separators=( ' [ ' , ' | ' , ' ] ' ) ,
user_identifier=<function <lambda> at 0x552ba28>,
referrer_actions=<function <lambda> at 0x552ba28>,
mode=' default ' )
Navbar with support for more templates This uses some code from the
old navbar. |
source code
|
|
|
__get_migrate(self,
tablename,
migrate=True) |
source code
|
|
|
enable_record_versioning(self,
tables,
archive_db=None,
archive_names=' %(tablename)s_archive ' ,
current_record=' current_record ' ,
current_record_label=None)
to enable full record versioning (including auth tables): |
source code
|
|
|
|
|
define_tables(self,
username=None,
signature=None,
migrate=None,
fake_migrate=None)
to be called unless tables are defined manually |
source code
|
|
|
|
|
get_or_create_user(self,
keys,
update_fields=[ ' email ' ] ,
login=True,
get=True)
Used for alternate login methods:
If the user exists already then password is updated. |
source code
|
|
|
|
|
login_user(self,
user)
login the user = db.auth_user(id) |
source code
|
|
|
|
|
login_bare(self,
username,
password)
logins user as specified by username (or email) and password |
source code
|
|
|
register_bare(self,
**fields)
registers a user as specified by username (or email) and a raw
password. |
source code
|
|
|
cas_login(self,
next=<function <lambda> at 0x552ba28>,
onvalidation=<function <lambda> at 0x552ba28>,
onaccept=<function <lambda> at 0x552ba28>,
log=<function <lambda> at 0x552ba28>,
version=2) |
source code
|
|
|
|
|
login(self,
next=<function <lambda> at 0x552ba28>,
onvalidation=<function <lambda> at 0x552ba28>,
onaccept=<function <lambda> at 0x552ba28>,
log=<function <lambda> at 0x552ba28>)
returns a login form |
source code
|
|
|
logout(self,
next=<function <lambda> at 0x552ba28>,
onlogout=<function <lambda> at 0x552ba28>,
log=<function <lambda> at 0x552ba28>)
logout and redirects to login |
source code
|
|
|
register(self,
next=<function <lambda> at 0x552ba28>,
onvalidation=<function <lambda> at 0x552ba28>,
onaccept=<function <lambda> at 0x552ba28>,
log=<function <lambda> at 0x552ba28>)
returns a registration form |
source code
|
|
|
|
|
verify_email(self,
next=<function <lambda> at 0x552ba28>,
onaccept=<function <lambda> at 0x552ba28>,
log=<function <lambda> at 0x552ba28>)
action user to verify the registration email, XXXXXXXXXXXXXXXX |
source code
|
|
|
retrieve_username(self,
next=<function <lambda> at 0x552ba28>,
onvalidation=<function <lambda> at 0x552ba28>,
onaccept=<function <lambda> at 0x552ba28>,
log=<function <lambda> at 0x552ba28>)
returns a form to retrieve the user username
(only if there is a username field) |
source code
|
|
|
|
|
reset_password_deprecated(self,
next=<function <lambda> at 0x552ba28>,
onvalidation=<function <lambda> at 0x552ba28>,
onaccept=<function <lambda> at 0x552ba28>,
log=<function <lambda> at 0x552ba28>)
returns a form to reset the user password (deprecated) |
source code
|
|
|
reset_password(self,
next=<function <lambda> at 0x552ba28>,
onvalidation=<function <lambda> at 0x552ba28>,
onaccept=<function <lambda> at 0x552ba28>,
log=<function <lambda> at 0x552ba28>)
returns a form to reset the user password |
source code
|
|
|
request_reset_password(self,
next=<function <lambda> at 0x552ba28>,
onvalidation=<function <lambda> at 0x552ba28>,
onaccept=<function <lambda> at 0x552ba28>,
log=<function <lambda> at 0x552ba28>)
returns a form to reset the user password |
source code
|
|
|
|
|
retrieve_password(self,
next=<function <lambda> at 0x552ba28>,
onvalidation=<function <lambda> at 0x552ba28>,
onaccept=<function <lambda> at 0x552ba28>,
log=<function <lambda> at 0x552ba28>) |
source code
|
|
|
change_password(self,
next=<function <lambda> at 0x552ba28>,
onvalidation=<function <lambda> at 0x552ba28>,
onaccept=<function <lambda> at 0x552ba28>,
log=<function <lambda> at 0x552ba28>)
returns a form that lets the user change password |
source code
|
|
|
profile(self,
next=<function <lambda> at 0x552ba28>,
onvalidation=<function <lambda> at 0x552ba28>,
onaccept=<function <lambda> at 0x552ba28>,
log=<function <lambda> at 0x552ba28>)
returns a form that lets the user change his/her profile |
source code
|
|
|
|
|
|
|
impersonate(self,
user_id=<function <lambda> at 0x552ba28>)
usage: POST TO http://..../impersonate
request.post_vars.user_id=<id> set request.post_vars.user_id to
0 to restore original user. |
source code
|
|
|
|
|
groups(self)
displays the groups and their roles for the logged in user |
source code
|
|
|
not_authorized(self)
you can change the view for this page to make it look as you like |
source code
|
|
|
requires(self,
condition,
requires_login=True,
otherwise=None)
decorator that prevents access to action if not logged in |
source code
|
|
|
requires_login(self,
otherwise=None)
decorator that prevents access to action if not logged in |
source code
|
|
|
requires_membership(self,
role=None,
group_id=None,
otherwise=None)
decorator that prevents access to action if not logged in or if user
logged in is not a member of group_id. |
source code
|
|
|
requires_permission(self,
name,
table_name='
' ,
record_id=0,
otherwise=None)
decorator that prevents access to action if not logged in or if user
logged in is not a member of any group (role) that has 'name' access
to 'table_name', 'record_id'. |
source code
|
|
|
requires_signature(self,
otherwise=None,
hash_vars=True)
decorator that prevents access to action if not logged in or if user
logged in is not a member of group_id. |
source code
|
|
|
add_group(self,
role,
description='
' )
creates a group associated to a role |
source code
|
|
|
|
|
id_group(self,
role)
returns the group_id of the group specified by the role |
source code
|
|
|
user_group(self,
user_id=None)
returns the group_id of the group uniquely associated to this user
i.e. |
source code
|
|
|
|
|
has_membership(self,
group_id=None,
user_id=None,
role=None)
checks if user is member of group_id or role |
source code
|
|
|
add_membership(self,
group_id=None,
user_id=None,
role=None)
gives user_id membership of group_id or role if user is None than
user_id is that of current logged in user |
source code
|
|
|
del_membership(self,
group_id=None,
user_id=None,
role=None)
revokes membership from group_id to user_id if user_id is None than
user_id is that of current logged in user |
source code
|
|
|
has_permission(self,
name=' any ' ,
table_name='
' ,
record_id=0,
user_id=None,
group_id=None)
checks if user_id or current logged in user is member of a group that
has 'name' permission on 'table_name' and 'record_id' if group_id is
passed, it checks whether the group has the permission |
source code
|
|
|
add_permission(self,
group_id,
name=' any ' ,
table_name='
' ,
record_id=0)
gives group_id 'name' access to 'table_name' and 'record_id' |
source code
|
|
|
del_permission(self,
group_id,
name=' any ' ,
table_name='
' ,
record_id=0)
revokes group_id 'name' access to 'table_name' and 'record_id' |
source code
|
|
|
accessible_query(self,
name,
table,
user_id=None)
returns a query with all accessible records for user_id or
the current logged in user
this method does not work on GAE because uses JOIN and IN |
source code
|
|
|
wiki(self,
slug=None,
env=None,
render=' markmin ' ,
manage_permissions=False,
force_prefix='
' ,
restrict_search=False,
resolve=True,
extra=None,
menu_groups=None,
templates=None,
migrate=True,
controller=None,
function=None,
force_render=False,
groups=None) |
source code
|
|
|
wikimenu(self)
to be used in menu.py for app wide wiki menus |
source code
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|