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