Table Of Contents

Previous topic

email_lib — Email

Next topic

webservice — Remote Framework Access via HTTP

This Page

profile — Profile

Profile object

class Profile(self, name)

A profile object is created at the beginning of every request with details of the use. The global profile object is webnotes.user

roles
list of roles assigned including ‘All’ (for logged user) or ‘Guest’ for not logged user
can_create
list of DocTypes the user can create
can_read
list of DocTypes the user can read
can_write
list of DocTypes the user can edit
get_roles()
get list of roles
get_allow_list(key)
internal - get list of DocType where key is allowed. Key is either ‘read’, ‘write’ or ‘create’
get_create_list()
get list of DocTypes the user can create. Will filter DocTypes tagged with ‘not_in_create’ and table
get_read_list()
get list of DocTypes the user can read
get_write_list()
get list of DocTypes the user can write
def get_home_page()
get the name of the user’s home page from the Control Panel
get_defaults()
get the user’s default values based on user and role profile
get_random_password()
generate a random password
reset_password():
reset the user’s password and send an email
update_recent(dt, dn)
update the user’s Recent list with the given dt and dn
load_profile()
return a dictionary of user properites to be stored in the session
load_from_session(self):
setup the user profile from the dictionary saved in the session (generated by load_profile)