You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

78 lines
1.9 KiB

  1. :mod:`profile` --- Profile
  2. ==========================
  3. .. module::profile
  4. :synopsis: Profile module
  5. Profile object
  6. --------------
  7. .. class:: Profile(self, name)
  8. A profile object is created at the beginning of every request with details of the use.
  9. The global profile object is `webnotes.user`
  10. .. attribute:: roles
  11. list of roles assigned including 'All' (for logged user) or 'Guest' for not logged user
  12. .. attribute:: can_create
  13. list of DocTypes the user can create
  14. .. attribute:: can_read
  15. list of DocTypes the user can read
  16. .. attribute:: can_write
  17. list of DocTypes the user can edit
  18. .. method:: get_roles()
  19. get list of roles
  20. .. method:: get_allow_list(key)
  21. internal - get list of DocType where `key` is allowed. Key is either 'read', 'write' or 'create'
  22. .. method:: get_create_list()
  23. get list of DocTypes the user can create. Will filter DocTypes tagged with 'not_in_create' and table
  24. .. method:: get_read_list()
  25. get list of DocTypes the user can read
  26. .. method:: get_write_list()
  27. get list of DocTypes the user can write
  28. .. method:: def get_home_page()
  29. get the name of the user's home page from the `Control Panel`
  30. .. method:: get_defaults()
  31. get the user's default values based on user and role profile
  32. .. method:: get_random_password()
  33. generate a random password
  34. .. method:: reset_password():
  35. reset the user's password and send an email
  36. .. method:: update_recent(dt, dn)
  37. update the user's `Recent` list with the given `dt` and `dn`
  38. .. method:: load_profile()
  39. return a dictionary of user properites to be stored in the session
  40. .. method:: load_from_session(self):
  41. setup the user profile from the dictionary saved in the session (generated by `load_profile`)