modpol/docs/doc/modules/modpol.orgs.base.html

477 lines
11 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Modpol</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
<li><a href="../modules/change_modules.html">change_modules</a></li>
<li><a href="../modules/change_modules.html">change_modules</a></li>
<li><a href="../modules/consent.html">consent</a></li>
<li><a href="../modules/create_token.html">create_token</a></li>
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
<li><a href="../modules/display_processes.html">display_processes</a></li>
<li><a href="../modules/join_org.html">join_org</a></li>
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
<li><a href="../modules/leave_org.html">leave_org</a></li>
<li><a href="../modules/message_org.html">message_org</a></li>
<li><a href="../modules/randomizer.html">randomizer</a></li>
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
<li><a href="../modules/remove_org.html">remove_org</a></li>
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
<li><a href="../modules/remove_process.html">remove_process</a></li>
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
<li><a href="../modules/send_token.html">send_token</a></li>
<li><a href="../modules/module_template.html">module_template</a></li>
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
<li><strong>modpol.orgs.base</strong></li>
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>modpol.orgs.base</code></h1>
<p>Basic function for orgs</p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#modpol.orgs.get_org">modpol.orgs.get_org (arg)</a></td>
<td class="summary">Return org when given its id or name</td>
</tr>
<tr>
<td class="name" nowrap><a href="#modpol.orgs.list_all">modpol.orgs.list_all ()</a></td>
<td class="summary">Return a table list of all org names</td>
</tr>
<tr>
<td class="name" nowrap><a href="#modpol.orgs.user_orgs">modpol.orgs.user_orgs (user)</a></td>
<td class="summary">Return the orgs of a user</td>
</tr>
<tr>
<td class="name" nowrap><a href="#modpol.orgs.reset">modpol.orgs.reset ()</a></td>
<td class="summary">Deletes all orgs except for the</td>
</tr>
<tr>
<td class="name" nowrap><a href="#modpol.orgs.init_instance">modpol.orgs.init_instance ()</a></td>
<td class="summary">Initializes the instance (root org)
can only be run once, as only one instance can exist</td>
</tr>
<tr>
<td class="name" nowrap><a href="#modpol.orgs:record">modpol.orgs:record ()</a></td>
<td class="summary">Records a log message to the modpol ledger</td>
</tr>
<tr>
<td class="name" nowrap><a href="#modpol.orgs:add_org">modpol.orgs:add_org (name, user)</a></td>
<td class="summary">Adds a new sub org to the org it is called on.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#modpol.orgs:delete">modpol.orgs:delete ()</a></td>
<td class="summary">Recursively deletes an org and its suborgs
Leaves entry in modpol.orgs.array as a string "removed".</td>
</tr>
<tr>
<td class="name" nowrap><a href="#modpol.orgs:get_member_index">modpol.orgs:get_member_index (member)</a></td>
<td class="summary">Internal function to get the index of a member name</td>
</tr>
<tr>
<td class="name" nowrap><a href="#modpol.orgs:add_member">modpol.orgs:add_member (user)</a></td>
<td class="summary">Adds a user to an org</td>
</tr>
<tr>
<td class="name" nowrap><a href="#modpol.orgs:remove_member">modpol.orgs:remove_member (user)</a></td>
<td class="summary">Removes a user from an org</td>
</tr>
<tr>
<td class="name" nowrap><a href="#modpol.orgs:has_member">modpol.orgs:has_member (user)</a></td>
<td class="summary">Boolean check whether user is an org</td>
</tr>
<tr>
<td class="name" nowrap><a href="#modpol.orgs:list_members">modpol.orgs:list_members ()</a></td>
<td class="summary"></td>
</tr>
<tr>
<td class="name" nowrap><a href="#modpol.orgs:get_member_count">modpol.orgs:get_member_count ()</a></td>
<td class="summary">Because member list uses lazy deletion, using #org.members will not show an accurate number</td>
</tr>
<tr>
<td class="name" nowrap><a href="#modpol.orgs:set_policy">modpol.orgs:set_policy (policy_type, process_type, must_be_member)</a></td>
<td class="summary">Adds a new policy to the policy table.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "modpol.orgs.get_org"></a>
<strong>modpol.orgs.get_org (arg)</strong>
</dt>
<dd>
Return org when given its id or name
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">arg</span>
string for name of org or id of org
</li>
</ul>
<h3>Returns:</h3>
<ol>
org specified by id or name
</ol>
</dd>
<dt>
<a name = "modpol.orgs.list_all"></a>
<strong>modpol.orgs.list_all ()</strong>
</dt>
<dd>
Return a table list of all org names
<h3>Returns:</h3>
<ol>
a table list of all org names
</ol>
</dd>
<dt>
<a name = "modpol.orgs.user_orgs"></a>
<strong>modpol.orgs.user_orgs (user)</strong>
</dt>
<dd>
Return the orgs of a user
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">user</span>
string of user name
</li>
</ul>
<h3>Returns:</h3>
<ol>
table of strings of org names
</ol>
</dd>
<dt>
<a name = "modpol.orgs.reset"></a>
<strong>modpol.orgs.reset ()</strong>
</dt>
<dd>
Deletes all orgs except for the
</dd>
<dt>
<a name = "modpol.orgs.init_instance"></a>
<strong>modpol.orgs.init_instance ()</strong>
</dt>
<dd>
Initializes the instance (root org)
can only be run once, as only one instance can exist
</dd>
<dt>
<a name = "modpol.orgs:record"></a>
<strong>modpol.orgs:record ()</strong>
</dt>
<dd>
Records a log message to the modpol ledger
</dd>
<dt>
<a name = "modpol.orgs:add_org"></a>
<strong>modpol.orgs:add_org (name, user)</strong>
</dt>
<dd>
Adds a new sub org to the org it is called on.
Ex: instance:add_org('town hall')
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
(string) name of new org
</li>
<li><span class="parameter">user</span>
(string)
</li>
</ul>
<h3>Returns:</h3>
<ol>
child org created
</ol>
</dd>
<dt>
<a name = "modpol.orgs:delete"></a>
<strong>modpol.orgs:delete ()</strong>
</dt>
<dd>
Recursively deletes an org and its suborgs
Leaves entry in modpol.orgs.array as a string "removed".
Note: "reason" param was removed, can be added back
</dd>
<dt>
<a name = "modpol.orgs:get_member_index"></a>
<strong>modpol.orgs:get_member_index (member)</strong>
</dt>
<dd>
Internal function to get the index of a member name
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">member</span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
index of given member
</ol>
</dd>
<dt>
<a name = "modpol.orgs:add_member"></a>
<strong>modpol.orgs:add_member (user)</strong>
</dt>
<dd>
Adds a user to an org
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">user</span>
</li>
</ul>
</dd>
<dt>
<a name = "modpol.orgs:remove_member"></a>
<strong>modpol.orgs:remove_member (user)</strong>
</dt>
<dd>
Removes a user from an org
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">user</span>
</li>
</ul>
</dd>
<dt>
<a name = "modpol.orgs:has_member"></a>
<strong>modpol.orgs:has_member (user)</strong>
</dt>
<dd>
Boolean check whether user is an org
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">user</span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
true if user is in org, false if not
</ol>
</dd>
<dt>
<a name = "modpol.orgs:list_members"></a>
<strong>modpol.orgs:list_members ()</strong>
</dt>
<dd>
<h3>Returns:</h3>
<ol>
a table of the names (string) of members
</ol>
</dd>
<dt>
<a name = "modpol.orgs:get_member_count"></a>
<strong>modpol.orgs:get_member_count ()</strong>
</dt>
<dd>
Because member list uses lazy deletion, using #org.members will not show an accurate number
<h3>Returns:</h3>
<ol>
numbers of members
</ol>
</dd>
<dt>
<a name = "modpol.orgs:set_policy"></a>
<strong>modpol.orgs:set_policy (policy_type, process_type, must_be_member)</strong>
</dt>
<dd>
Adds a new policy to the policy table.
Must define the policy type, process associated with it, and whether the request must be made by an org member
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">policy_type</span>
</li>
<li><span class="parameter">process_type</span>
</li>
<li><span class="parameter">must_be_member</span>
Boolean
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>