2
0

modpol.orgs.base.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  5. <head>
  6. <title>Reference</title>
  7. <link rel="stylesheet" href="../ldoc.css" type="text/css" />
  8. </head>
  9. <body>
  10. <div id="container">
  11. <div id="product">
  12. <div id="product_logo"></div>
  13. <div id="product_name"><big><b></b></big></div>
  14. <div id="product_description"></div>
  15. </div> <!-- id="product" -->
  16. <div id="main">
  17. <!-- Menu -->
  18. <div id="navigation">
  19. <br/>
  20. <h1>Modpol</h1>
  21. <ul>
  22. <li><a href="../index.html">Index</a></li>
  23. </ul>
  24. <h2>Contents</h2>
  25. <ul>
  26. <li><a href="#Functions">Functions</a></li>
  27. </ul>
  28. <h2>Modules</h2>
  29. <ul class="nowrap">
  30. <li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
  31. <li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
  32. <li><a href="../modules/change_modules.html">change_modules</a></li>
  33. <li><a href="../modules/change_modules.html">change_modules</a></li>
  34. <li><a href="../modules/consent.html">consent</a></li>
  35. <li><a href="../modules/create_token.html">create_token</a></li>
  36. <li><a href="../modules/defer_consent.html">defer_consent</a></li>
  37. <li><a href="../modules/display_processes.html">display_processes</a></li>
  38. <li><a href="../modules/join_org.html">join_org</a></li>
  39. <li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
  40. <li><a href="../modules/leave_org.html">leave_org</a></li>
  41. <li><a href="../modules/message_org.html">message_org</a></li>
  42. <li><a href="../modules/randomizer.html">randomizer</a></li>
  43. <li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
  44. <li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
  45. <li><a href="../modules/remove_org.html">remove_org</a></li>
  46. <li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
  47. <li><a href="../modules/remove_process.html">remove_process</a></li>
  48. <li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
  49. <li><a href="../modules/send_token.html">send_token</a></li>
  50. <li><a href="../modules/module_template.html">module_template</a></li>
  51. <li><a href="../modules/tokenomics.html">tokenomics</a></li>
  52. <li><strong>modpol.orgs.base</strong></li>
  53. <li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
  54. <li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
  55. <li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
  56. <li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
  57. <li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
  58. </ul>
  59. </div>
  60. <div id="content">
  61. <h1>Module <code>modpol.orgs.base</code></h1>
  62. <p>Basic function for orgs</p>
  63. <p></p>
  64. <h2><a href="#Functions">Functions</a></h2>
  65. <table class="function_list">
  66. <tr>
  67. <td class="name" nowrap><a href="#modpol.orgs.get_org">modpol.orgs.get_org (arg)</a></td>
  68. <td class="summary">Return org when given its id or name</td>
  69. </tr>
  70. <tr>
  71. <td class="name" nowrap><a href="#modpol.orgs.list_all">modpol.orgs.list_all ()</a></td>
  72. <td class="summary">Return a table list of all org names</td>
  73. </tr>
  74. <tr>
  75. <td class="name" nowrap><a href="#modpol.orgs.user_orgs">modpol.orgs.user_orgs (user)</a></td>
  76. <td class="summary">Return the orgs of a user</td>
  77. </tr>
  78. <tr>
  79. <td class="name" nowrap><a href="#modpol.orgs.reset">modpol.orgs.reset ()</a></td>
  80. <td class="summary">Deletes all orgs except for the</td>
  81. </tr>
  82. <tr>
  83. <td class="name" nowrap><a href="#modpol.orgs.init_instance">modpol.orgs.init_instance ()</a></td>
  84. <td class="summary">Initializes the instance (root org)
  85. can only be run once, as only one instance can exist</td>
  86. </tr>
  87. <tr>
  88. <td class="name" nowrap><a href="#modpol.orgs:record">modpol.orgs:record ()</a></td>
  89. <td class="summary">Records a log message to the modpol ledger</td>
  90. </tr>
  91. <tr>
  92. <td class="name" nowrap><a href="#modpol.orgs:add_org">modpol.orgs:add_org (name, user)</a></td>
  93. <td class="summary">Adds a new sub org to the org it is called on.</td>
  94. </tr>
  95. <tr>
  96. <td class="name" nowrap><a href="#modpol.orgs:delete">modpol.orgs:delete ()</a></td>
  97. <td class="summary">Recursively deletes an org and its suborgs
  98. Leaves entry in modpol.orgs.array as a string "removed".</td>
  99. </tr>
  100. <tr>
  101. <td class="name" nowrap><a href="#modpol.orgs:get_member_index">modpol.orgs:get_member_index (member)</a></td>
  102. <td class="summary">Internal function to get the index of a member name</td>
  103. </tr>
  104. <tr>
  105. <td class="name" nowrap><a href="#modpol.orgs:add_member">modpol.orgs:add_member (user)</a></td>
  106. <td class="summary">Adds a user to an org</td>
  107. </tr>
  108. <tr>
  109. <td class="name" nowrap><a href="#modpol.orgs:remove_member">modpol.orgs:remove_member (user)</a></td>
  110. <td class="summary">Removes a user from an org</td>
  111. </tr>
  112. <tr>
  113. <td class="name" nowrap><a href="#modpol.orgs:has_member">modpol.orgs:has_member (user)</a></td>
  114. <td class="summary">Boolean check whether user is an org</td>
  115. </tr>
  116. <tr>
  117. <td class="name" nowrap><a href="#modpol.orgs:list_members">modpol.orgs:list_members ()</a></td>
  118. <td class="summary"></td>
  119. </tr>
  120. <tr>
  121. <td class="name" nowrap><a href="#modpol.orgs:get_member_count">modpol.orgs:get_member_count ()</a></td>
  122. <td class="summary">Because member list uses lazy deletion, using #org.members will not show an accurate number</td>
  123. </tr>
  124. <tr>
  125. <td class="name" nowrap><a href="#modpol.orgs:set_policy">modpol.orgs:set_policy (policy_type, process_type, must_be_member)</a></td>
  126. <td class="summary">Adds a new policy to the policy table.</td>
  127. </tr>
  128. </table>
  129. <br/>
  130. <br/>
  131. <h2 class="section-header "><a name="Functions"></a>Functions</h2>
  132. <dl class="function">
  133. <dt>
  134. <a name = "modpol.orgs.get_org"></a>
  135. <strong>modpol.orgs.get_org (arg)</strong>
  136. </dt>
  137. <dd>
  138. Return org when given its id or name
  139. <h3>Parameters:</h3>
  140. <ul>
  141. <li><span class="parameter">arg</span>
  142. string for name of org or id of org
  143. </li>
  144. </ul>
  145. <h3>Returns:</h3>
  146. <ol>
  147. org specified by id or name
  148. </ol>
  149. </dd>
  150. <dt>
  151. <a name = "modpol.orgs.list_all"></a>
  152. <strong>modpol.orgs.list_all ()</strong>
  153. </dt>
  154. <dd>
  155. Return a table list of all org names
  156. <h3>Returns:</h3>
  157. <ol>
  158. a table list of all org names
  159. </ol>
  160. </dd>
  161. <dt>
  162. <a name = "modpol.orgs.user_orgs"></a>
  163. <strong>modpol.orgs.user_orgs (user)</strong>
  164. </dt>
  165. <dd>
  166. Return the orgs of a user
  167. <h3>Parameters:</h3>
  168. <ul>
  169. <li><span class="parameter">user</span>
  170. string of user name
  171. </li>
  172. </ul>
  173. <h3>Returns:</h3>
  174. <ol>
  175. table of strings of org names
  176. </ol>
  177. </dd>
  178. <dt>
  179. <a name = "modpol.orgs.reset"></a>
  180. <strong>modpol.orgs.reset ()</strong>
  181. </dt>
  182. <dd>
  183. Deletes all orgs except for the
  184. </dd>
  185. <dt>
  186. <a name = "modpol.orgs.init_instance"></a>
  187. <strong>modpol.orgs.init_instance ()</strong>
  188. </dt>
  189. <dd>
  190. Initializes the instance (root org)
  191. can only be run once, as only one instance can exist
  192. </dd>
  193. <dt>
  194. <a name = "modpol.orgs:record"></a>
  195. <strong>modpol.orgs:record ()</strong>
  196. </dt>
  197. <dd>
  198. Records a log message to the modpol ledger
  199. </dd>
  200. <dt>
  201. <a name = "modpol.orgs:add_org"></a>
  202. <strong>modpol.orgs:add_org (name, user)</strong>
  203. </dt>
  204. <dd>
  205. Adds a new sub org to the org it is called on.
  206. Ex: instance:add_org('town hall')
  207. <h3>Parameters:</h3>
  208. <ul>
  209. <li><span class="parameter">name</span>
  210. (string) name of new org
  211. </li>
  212. <li><span class="parameter">user</span>
  213. (string)
  214. </li>
  215. </ul>
  216. <h3>Returns:</h3>
  217. <ol>
  218. child org created
  219. </ol>
  220. </dd>
  221. <dt>
  222. <a name = "modpol.orgs:delete"></a>
  223. <strong>modpol.orgs:delete ()</strong>
  224. </dt>
  225. <dd>
  226. Recursively deletes an org and its suborgs
  227. Leaves entry in modpol.orgs.array as a string "removed".
  228. Note: "reason" param was removed, can be added back
  229. </dd>
  230. <dt>
  231. <a name = "modpol.orgs:get_member_index"></a>
  232. <strong>modpol.orgs:get_member_index (member)</strong>
  233. </dt>
  234. <dd>
  235. Internal function to get the index of a member name
  236. <h3>Parameters:</h3>
  237. <ul>
  238. <li><span class="parameter">member</span>
  239. </li>
  240. </ul>
  241. <h3>Returns:</h3>
  242. <ol>
  243. index of given member
  244. </ol>
  245. </dd>
  246. <dt>
  247. <a name = "modpol.orgs:add_member"></a>
  248. <strong>modpol.orgs:add_member (user)</strong>
  249. </dt>
  250. <dd>
  251. Adds a user to an org
  252. <h3>Parameters:</h3>
  253. <ul>
  254. <li><span class="parameter">user</span>
  255. </li>
  256. </ul>
  257. </dd>
  258. <dt>
  259. <a name = "modpol.orgs:remove_member"></a>
  260. <strong>modpol.orgs:remove_member (user)</strong>
  261. </dt>
  262. <dd>
  263. Removes a user from an org
  264. <h3>Parameters:</h3>
  265. <ul>
  266. <li><span class="parameter">user</span>
  267. </li>
  268. </ul>
  269. </dd>
  270. <dt>
  271. <a name = "modpol.orgs:has_member"></a>
  272. <strong>modpol.orgs:has_member (user)</strong>
  273. </dt>
  274. <dd>
  275. Boolean check whether user is an org
  276. <h3>Parameters:</h3>
  277. <ul>
  278. <li><span class="parameter">user</span>
  279. </li>
  280. </ul>
  281. <h3>Returns:</h3>
  282. <ol>
  283. true if user is in org, false if not
  284. </ol>
  285. </dd>
  286. <dt>
  287. <a name = "modpol.orgs:list_members"></a>
  288. <strong>modpol.orgs:list_members ()</strong>
  289. </dt>
  290. <dd>
  291. <h3>Returns:</h3>
  292. <ol>
  293. a table of the names (string) of members
  294. </ol>
  295. </dd>
  296. <dt>
  297. <a name = "modpol.orgs:get_member_count"></a>
  298. <strong>modpol.orgs:get_member_count ()</strong>
  299. </dt>
  300. <dd>
  301. Because member list uses lazy deletion, using #org.members will not show an accurate number
  302. <h3>Returns:</h3>
  303. <ol>
  304. numbers of members
  305. </ol>
  306. </dd>
  307. <dt>
  308. <a name = "modpol.orgs:set_policy"></a>
  309. <strong>modpol.orgs:set_policy (policy_type, process_type, must_be_member)</strong>
  310. </dt>
  311. <dd>
  312. Adds a new policy to the policy table.
  313. Must define the policy type, process associated with it, and whether the request must be made by an org member
  314. <h3>Parameters:</h3>
  315. <ul>
  316. <li><span class="parameter">policy_type</span>
  317. </li>
  318. <li><span class="parameter">process_type</span>
  319. </li>
  320. <li><span class="parameter">must_be_member</span>
  321. Boolean
  322. </li>
  323. </ul>
  324. </dd>
  325. </dl>
  326. </div> <!-- id="content" -->
  327. </div> <!-- id="main" -->
  328. <div id="about">
  329. <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
  330. <i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
  331. </div> <!-- id="about" -->
  332. </div> <!-- id="container" -->
  333. </body>
  334. </html>