214 lines
No EOL
9.9 KiB
HTML
214 lines
No EOL
9.9 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
<title>profile — Profile — Documentation</title>
|
|
<link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" />
|
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
|
<script type="text/javascript">
|
|
var DOCUMENTATION_OPTIONS = {
|
|
URL_ROOT: '',
|
|
VERSION: '',
|
|
COLLAPSE_MODINDEX: false,
|
|
FILE_SUFFIX: '.html',
|
|
HAS_SOURCE: true
|
|
};
|
|
</script>
|
|
<script type="text/javascript" src="_static/jquery.js"></script>
|
|
<script type="text/javascript" src="_static/doctools.js"></script>
|
|
<link rel="top" title="Documentation" href="index.html" />
|
|
<link rel="up" title="3. Server Side API" href="server_side_api.html" />
|
|
<link rel="next" title="webservice — Remote Framework Access via HTTP" href="webservice.html" />
|
|
<link rel="prev" title="email_lib — Email" href="email_lib.html" />
|
|
</head>
|
|
<body>
|
|
<div style="background-color: #FFF; text-align: left; padding: 8px 0px"><img src="_static/banner300910.gif"></div>
|
|
<div class="related">
|
|
<h3>Navigation</h3>
|
|
<ul>
|
|
<li class="right" style="margin-right: 10px">
|
|
<a href="genindex.html" title="General Index"
|
|
accesskey="I">index</a></li>
|
|
<li class="right" >
|
|
<a href="modindex.html" title="Global Module Index"
|
|
accesskey="M">modules</a> |</li>
|
|
<li class="right" >
|
|
<a href="webservice.html" title="webservice — Remote Framework Access via HTTP"
|
|
accesskey="N">next</a> |</li>
|
|
<li class="right" >
|
|
<a href="email_lib.html" title="email_lib — Email"
|
|
accesskey="P">previous</a> |</li>
|
|
<li><a href="index.html">Documentation</a> »</li>
|
|
<li><a href="server_side_api.html" accesskey="U">3. Server Side API</a> »</li>
|
|
</ul>
|
|
</div>
|
|
<div class="sphinxsidebar">
|
|
<div class="sphinxsidebarwrapper">
|
|
<h3><a href="index.html">Table Of Contents</a></h3>
|
|
<ul>
|
|
<li><a class="reference external" href=""><tt class="docutils literal"><span class="pre">profile</span></tt> — Profile</a><ul>
|
|
<li><a class="reference external" href="#profile-object">Profile object</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
<h4>Previous topic</h4>
|
|
<p class="topless"><a href="email_lib.html"
|
|
title="previous chapter"><tt class="docutils literal docutils literal"><span class="pre">email_lib</span></tt> — Email</a></p>
|
|
<h4>Next topic</h4>
|
|
<p class="topless"><a href="webservice.html"
|
|
title="next chapter"><tt class="docutils literal"><span class="pre">webservice</span></tt> — Remote Framework Access via HTTP</a></p>
|
|
<h3>This Page</h3>
|
|
<ul class="this-page-menu">
|
|
<li><a href="_sources/profile.txt"
|
|
rel="nofollow">Show Source</a></li>
|
|
</ul>
|
|
<div id="searchbox" style="display: none">
|
|
<h3>Quick search</h3>
|
|
<form class="search" action="search.html" method="get">
|
|
<input type="text" name="q" size="18" />
|
|
<input type="submit" value="Go" />
|
|
<input type="hidden" name="check_keywords" value="yes" />
|
|
<input type="hidden" name="area" value="default" />
|
|
</form>
|
|
<p class="searchtip" style="font-size: 90%">
|
|
Enter search terms or a module, class or function name.
|
|
</p>
|
|
</div>
|
|
<script type="text/javascript">$('#searchbox').show(0);</script>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="document">
|
|
<div class="documentwrapper">
|
|
<div class="bodywrapper">
|
|
<div class="body">
|
|
|
|
<div class="section" id="profile-profile">
|
|
<h1><tt class="xref docutils literal"><span class="pre">profile</span></tt> — Profile<a class="headerlink" href="#profile-profile" title="Permalink to this headline">¶</a></h1>
|
|
<div class="section" id="profile-object">
|
|
<h2>Profile object<a class="headerlink" href="#profile-object" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="class">
|
|
<dt id="Profile">
|
|
<em class="property">class </em><tt class="descname">Profile</tt><big>(</big><em>self</em>, <em>name</em><big>)</big><a class="headerlink" href="#Profile" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>A profile object is created at the beginning of every request with details of the use.
|
|
The global profile object is <cite>webnotes.user</cite></p>
|
|
<dl class="attribute">
|
|
<dt id="Profile.roles">
|
|
<tt class="descname">roles</tt><a class="headerlink" href="#Profile.roles" title="Permalink to this definition">¶</a></dt>
|
|
<dd>list of roles assigned including ‘All’ (for logged user) or ‘Guest’ for not logged user</dd></dl>
|
|
|
|
<dl class="attribute">
|
|
<dt id="Profile.can_create">
|
|
<tt class="descname">can_create</tt><a class="headerlink" href="#Profile.can_create" title="Permalink to this definition">¶</a></dt>
|
|
<dd>list of DocTypes the user can create</dd></dl>
|
|
|
|
<dl class="attribute">
|
|
<dt id="Profile.can_read">
|
|
<tt class="descname">can_read</tt><a class="headerlink" href="#Profile.can_read" title="Permalink to this definition">¶</a></dt>
|
|
<dd>list of DocTypes the user can read</dd></dl>
|
|
|
|
<dl class="attribute">
|
|
<dt id="Profile.can_write">
|
|
<tt class="descname">can_write</tt><a class="headerlink" href="#Profile.can_write" title="Permalink to this definition">¶</a></dt>
|
|
<dd>list of DocTypes the user can edit</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="Profile.get_roles">
|
|
<tt class="descname">get_roles</tt><big>(</big><big>)</big><a class="headerlink" href="#Profile.get_roles" title="Permalink to this definition">¶</a></dt>
|
|
<dd>get list of roles</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="Profile.get_allow_list">
|
|
<tt class="descname">get_allow_list</tt><big>(</big><em>key</em><big>)</big><a class="headerlink" href="#Profile.get_allow_list" title="Permalink to this definition">¶</a></dt>
|
|
<dd>internal - get list of DocType where <cite>key</cite> is allowed. Key is either ‘read’, ‘write’ or ‘create’</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="Profile.get_create_list">
|
|
<tt class="descname">get_create_list</tt><big>(</big><big>)</big><a class="headerlink" href="#Profile.get_create_list" title="Permalink to this definition">¶</a></dt>
|
|
<dd>get list of DocTypes the user can create. Will filter DocTypes tagged with ‘not_in_create’ and table</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="Profile.get_read_list">
|
|
<tt class="descname">get_read_list</tt><big>(</big><big>)</big><a class="headerlink" href="#Profile.get_read_list" title="Permalink to this definition">¶</a></dt>
|
|
<dd>get list of DocTypes the user can read</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="Profile.get_write_list">
|
|
<tt class="descname">get_write_list</tt><big>(</big><big>)</big><a class="headerlink" href="#Profile.get_write_list" title="Permalink to this definition">¶</a></dt>
|
|
<dd>get list of DocTypes the user can write</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt>
|
|
<tt class="descname">def get_home_page()</tt></dt>
|
|
<dd>get the name of the user’s home page from the <cite>Control Panel</cite></dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="Profile.get_defaults">
|
|
<tt class="descname">get_defaults</tt><big>(</big><big>)</big><a class="headerlink" href="#Profile.get_defaults" title="Permalink to this definition">¶</a></dt>
|
|
<dd>get the user’s default values based on user and role profile</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="Profile.get_random_password">
|
|
<tt class="descname">get_random_password</tt><big>(</big><big>)</big><a class="headerlink" href="#Profile.get_random_password" title="Permalink to this definition">¶</a></dt>
|
|
<dd>generate a random password</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt>
|
|
<tt class="descname">reset_password():</tt></dt>
|
|
<dd>reset the user’s password and send an email</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="Profile.update_recent">
|
|
<tt class="descname">update_recent</tt><big>(</big><em>dt</em>, <em>dn</em><big>)</big><a class="headerlink" href="#Profile.update_recent" title="Permalink to this definition">¶</a></dt>
|
|
<dd>update the user’s <cite>Recent</cite> list with the given <cite>dt</cite> and <cite>dn</cite></dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="Profile.load_profile">
|
|
<tt class="descname">load_profile</tt><big>(</big><big>)</big><a class="headerlink" href="#Profile.load_profile" title="Permalink to this definition">¶</a></dt>
|
|
<dd>return a dictionary of user properites to be stored in the session</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt>
|
|
<tt class="descname">load_from_session(self):</tt></dt>
|
|
<dd>setup the user profile from the dictionary saved in the session (generated by <cite>load_profile</cite>)</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="clearer"></div>
|
|
</div>
|
|
<div class="related">
|
|
<h3>Navigation</h3>
|
|
<ul>
|
|
<li class="right" style="margin-right: 10px">
|
|
<a href="genindex.html" title="General Index"
|
|
>index</a></li>
|
|
<li class="right" >
|
|
<a href="modindex.html" title="Global Module Index"
|
|
>modules</a> |</li>
|
|
<li class="right" >
|
|
<a href="webservice.html" title="webservice — Remote Framework Access via HTTP"
|
|
>next</a> |</li>
|
|
<li class="right" >
|
|
<a href="email_lib.html" title="email_lib — Email"
|
|
>previous</a> |</li>
|
|
<li><a href="index.html">Documentation</a> »</li>
|
|
<li><a href="server_side_api.html" >3. Server Side API</a> »</li>
|
|
</ul>
|
|
</div>
|
|
<div class="footer">
|
|
© Copyright 2010, Rushabh Mehta.
|
|
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.3.
|
|
</div>
|
|
</body>
|
|
</html> |