modpol.orgs.base.html 10 KB

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