Files
factorio-scenario-ExpCluster/doc/modules/expcore.permission_groups.html
2019-05-29 22:31:23 +01:00

661 lines
22 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>ldoc</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="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/config._file_loader.html">config._file_loader</a></li>
<li><a href="../modules/config.action_buttons.html">config.action_buttons</a></li>
<li><a href="../modules/config.advanced_start.html">config.advanced_start</a></li>
<li><a href="../modules/config.death_logger.html">config.death_logger</a></li>
<li><a href="../modules/config.expcore-commands.auth_admin.html">config.expcore-commands.auth_admin</a></li>
<li><a href="../modules/config.expcore-commands.auth_roles.html">config.expcore-commands.auth_roles</a></li>
<li><a href="../modules/config.expcore-commands.auth_runtime_disable.html">config.expcore-commands.auth_runtime_disable</a></li>
<li><a href="../modules/config.expcore-commands.parse_general.html">config.expcore-commands.parse_general</a></li>
<li><a href="../modules/config.expcore-commands.parse_roles.html">config.expcore-commands.parse_roles</a></li>
<li><a href="../modules/config.permission_groups.html">config.permission_groups</a></li>
<li><a href="../modules/config.popup_messages.html">config.popup_messages</a></li>
<li><a href="../modules/config.rockets.html">config.rockets</a></li>
<li><a href="../modules/config.roles.html">config.roles</a></li>
<li><a href="../modules/config.scorched_earth.html">config.scorched_earth</a></li>
<li><a href="../modules/config.spawn_area.html">config.spawn_area</a></li>
<li><a href="../modules/config.warnings.html">config.warnings</a></li>
<li><a href="../modules/control.html">control</a></li>
<li><a href="../modules/expcore.commands.html">expcore.commands</a></li>
<li><a href="../modules/expcore.common.html">expcore.common</a></li>
<li><a href="../modules/expcore.gui.html">expcore.gui</a></li>
<li><a href="../modules/expcore.gui.buttons.html">expcore.gui.buttons</a></li>
<li><a href="../modules/expcore.gui.center.html">expcore.gui.center</a></li>
<li><a href="../modules/expcore.gui.checkboxs.html">expcore.gui.checkboxs</a></li>
<li><a href="../modules/expcore.gui.core.html">expcore.gui.core</a></li>
<li><a href="../modules/expcore.gui.dropdown.html">expcore.gui.dropdown</a></li>
<li><a href="../modules/expcore.gui.elem-button.html">expcore.gui.elem-button</a></li>
<li><a href="../modules/expcore.gui.instances.html">expcore.gui.instances</a></li>
<li><a href="../modules/expcore.gui.left.html">expcore.gui.left</a></li>
<li><a href="../modules/expcore.gui.popups.html">expcore.gui.popups</a></li>
<li><a href="../modules/expcore.gui.progress-bar.html">expcore.gui.progress-bar</a></li>
<li><a href="../modules/expcore.gui.slider.html">expcore.gui.slider</a></li>
<li><a href="../modules/expcore.gui.test.html">expcore.gui.test</a></li>
<li><a href="../modules/expcore.gui.text.html">expcore.gui.text</a></li>
<li><a href="../modules/expcore.gui.toolbar.html">expcore.gui.toolbar</a></li>
<li><strong>expcore.permission_groups</strong></li>
<li><a href="../modules/expcore.roles.html">expcore.roles</a></li>
<li><a href="../modules/expcore.store.html">expcore.store</a></li>
<li><a href="../modules/modules.addons.advanced-start.html">modules.addons.advanced-start</a></li>
<li><a href="../modules/modules.addons.chat-popups.html">modules.addons.chat-popups</a></li>
<li><a href="../modules/modules.addons.damage-popups.html">modules.addons.damage-popups</a></li>
<li><a href="../modules/modules.gui.player-list.html">modules.gui.player-list</a></li>
<li><a href="../modules/modules.gui.rocket-info.html">modules.gui.rocket-info</a></li>
<li><a href="../modules/modules.gui.science-info.html">modules.gui.science-info</a></li>
<li><a href="../modules/modules.gui.task-list.html">modules.gui.task-list</a></li>
<li><a href="../modules/utils.alien_evolution_progress.html">utils.alien_evolution_progress</a></li>
<li><a href="../modules/utils.core.html">utils.core</a></li>
<li><a href="../modules/utils.debug.html">utils.debug</a></li>
<li><a href="../modules/utils.event.html">utils.event</a></li>
<li><a href="../modules/utils.event_core.html">utils.event_core</a></li>
<li><a href="../modules/utils.math.html">utils.math</a></li>
<li><a href="../modules/utils.recipe_locker.html">utils.recipe_locker</a></li>
<li><a href="../modules/utils.state_machine.html">utils.state_machine</a></li>
<li><a href="../modules/utils.table.html">utils.table</a></li>
<li><a href="../modules/utils.task.html">utils.task</a></li>
<li><a href="../modules/utils.timestamp.html">utils.timestamp</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>expcore.permission_groups</code></h1>
<p>Permission group making for factorio so you never have to make one by hand again</p>
<p>
[[</p>
<h3>Info:</h3>
<ul>
<li><strong>Author</strong>: Cooldude2606</li>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Permissions_Groups.new_group">Permissions_Groups.new_group (name)</a></td>
<td class="summary">Defines a new permission group that can have it actions set in the config</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Permissions_Groups.get_group_by_name">Permissions_Groups.get_group_by_name (name)</a></td>
<td class="summary">Returns the group with the given name, case sensitive</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Permissions_Groups.get_group_from_player">Permissions_Groups.get_group_from_player (player)</a></td>
<td class="summary">Returns the group that a player is in</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Permissions_Groups.reload_permissions">Permissions_Groups.reload_permissions ()</a></td>
<td class="summary">Reloads/creates all permission groups and sets them to they configured state</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Permissions_Groups.lockdown_permissions">Permissions_Groups.lockdown_permissions (exempt)</a></td>
<td class="summary">Removes all permissions from every permission group except for "Default" and any passed as exempt</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Permissions_Groups.set_player_group">Permissions_Groups.set_player_group (player, group)</a></td>
<td class="summary">Sets a player's group to the one given, a player can only have one group at a time</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Permissions_Groups._prototype:set_action">Permissions_Groups._prototype:set_action (action, state)</a></td>
<td class="summary">Sets the allow state of an action for this group, used internally but is safe to use else where</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Permissions_Groups._prototype:allow">Permissions_Groups._prototype:allow (actions)</a></td>
<td class="summary">Sets an action or actions to be allowed for this group even with disallow_all triggered, Do not use in runtime</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Permissions_Groups._prototype:disallow">Permissions_Groups._prototype:disallow (actions)</a></td>
<td class="summary">Sets an action or actions to be disallowed for this group even with allow_all triggered, Do not use in runtime</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Permissions_Groups._prototype:allow_all">Permissions_Groups._prototype:allow_all ()</a></td>
<td class="summary">Sets the default state for any actions not given to be allowed, useful with :disallow</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Permissions_Groups._prototype:disallow_all">Permissions_Groups._prototype:disallow_all ()</a></td>
<td class="summary">Sets the default state for any action not given to be disallowed, useful with :allow</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Permissions_Groups._prototype:is_allowed">Permissions_Groups._prototype:is_allowed (action)</a></td>
<td class="summary">Returns if an input action is allowed for this group</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Permissions_Groups._prototype:get_raw">Permissions_Groups._prototype:get_raw ()</a></td>
<td class="summary">Returns the LuaPermissionGroup that was created with this group object, used internally</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Permissions_Groups._prototype:create">Permissions_Groups._prototype:create ()</a></td>
<td class="summary">Creates or updates the permission group with the configured actions, used internally</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Permissions_Groups._prototype:add_player">Permissions_Groups._prototype:add_player (player)</a></td>
<td class="summary">Adds a player to this group</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Permissions_Groups._prototype:remove_player">Permissions_Groups._prototype:remove_player (player)</a></td>
<td class="summary">Removes a player from this group</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Permissions_Groups._prototype:get_players">Permissions_Groups._prototype:get_players ([online])</a></td>
<td class="summary">Returns all player that are in this group with the option to filter to online/offline only</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Permissions_Groups._prototype:print">Permissions_Groups._prototype:print (message)</a></td>
<td class="summary">Prints a message to every player in this group</td>
</tr>
</table>
<br/>
<br/>
<h2><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "Permissions_Groups.new_group"></a>
<strong>Permissions_Groups.new_group (name)</strong>
</dt>
<dd>
Defines a new permission group that can have it actions set in the config
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the name of the new group
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Permissions_Groups._prototype</span></span>
the new group made with function to allow and disallow actions
</ol>
</dd>
<dt>
<a name = "Permissions_Groups.get_group_by_name"></a>
<strong>Permissions_Groups.get_group_by_name (name)</strong>
</dt>
<dd>
Returns the group with the given name, case sensitive
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the name of the group to get
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Permissions_Groups._prototype</span> or <span class="type">nil</span></span>
the group with that name or nil if non found
</ol>
</dd>
<dt>
<a name = "Permissions_Groups.get_group_from_player"></a>
<strong>Permissions_Groups.get_group_from_player (player)</strong>
</dt>
<dd>
Returns the group that a player is in
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player</span>
<span class="types"><span class="type">LuaPlayer</span></span>
the player to get the group of can be name index etc
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Permissions_Groups._prototype</span> or <span class="type">nil</span></span>
the group with that player or nil if non found
</ol>
</dd>
<dt>
<a name = "Permissions_Groups.reload_permissions"></a>
<strong>Permissions_Groups.reload_permissions ()</strong>
</dt>
<dd>
Reloads/creates all permission groups and sets them to they configured state
</dd>
<dt>
<a name = "Permissions_Groups.lockdown_permissions"></a>
<strong>Permissions_Groups.lockdown_permissions (exempt)</strong>
</dt>
<dd>
Removes all permissions from every permission group except for "Default" and any passed as exempt
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">exempt</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.2/manual.html#6.4">string</a> or <span class="type">Array<string></span></span>
groups that you want to be except, "Default" is always exempt
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">number</span></span>
the number of groups that had they permissions removed
</ol>
</dd>
<dt>
<a name = "Permissions_Groups.set_player_group"></a>
<strong>Permissions_Groups.set_player_group (player, group)</strong>
</dt>
<dd>
Sets a player's group to the one given, a player can only have one group at a time
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player</span>
<span class="types"><span class="type">LuaPlayer</span></span>
the player to effect can be name index etc
</li>
<li><span class="parameter">group</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the name of the group to give to the player
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
true if the player was added successfully, false other wise
</ol>
</dd>
<dt>
<a name = "Permissions_Groups._prototype:set_action"></a>
<strong>Permissions_Groups._prototype:set_action (action, state)</strong>
</dt>
<dd>
Sets the allow state of an action for this group, used internally but is safe to use else where
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">action</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.2/manual.html#6.4">string</a> or <span class="type">defines.input_action</span></span>
the action that you want to set the state of
</li>
<li><span class="parameter">state</span>
<span class="types"><span class="type">boolean</span></span>
the state that you want to set it to, true = allow, false = disallow
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Permissions_Groups._prototype</span></span>
returns self so function can be chained
</ol>
</dd>
<dt>
<a name = "Permissions_Groups._prototype:allow"></a>
<strong>Permissions_Groups._prototype:allow (actions)</strong>
</dt>
<dd>
Sets an action or actions to be allowed for this group even with disallow_all triggered, Do not use in runtime
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">actions</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.2/manual.html#6.4">string</a> or <span class="type">Array<string></span></span>
the action or actions that you want to allow for this group
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Permissions_Groups._prototype</span></span>
returns self so function can be chained
</ol>
</dd>
<dt>
<a name = "Permissions_Groups._prototype:disallow"></a>
<strong>Permissions_Groups._prototype:disallow (actions)</strong>
</dt>
<dd>
Sets an action or actions to be disallowed for this group even with allow_all triggered, Do not use in runtime
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">actions</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.2/manual.html#6.4">string</a> or <span class="type">Array<string></span></span>
the action or actions that you want to disallow for this group
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Permissions_Groups._prototype</span></span>
returns self so function can be chained
</ol>
</dd>
<dt>
<a name = "Permissions_Groups._prototype:allow_all"></a>
<strong>Permissions_Groups._prototype:allow_all ()</strong>
</dt>
<dd>
Sets the default state for any actions not given to be allowed, useful with :disallow
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Permissions_Groups._prototype</span></span>
returns self so function can be chained
</ol>
</dd>
<dt>
<a name = "Permissions_Groups._prototype:disallow_all"></a>
<strong>Permissions_Groups._prototype:disallow_all ()</strong>
</dt>
<dd>
Sets the default state for any action not given to be disallowed, useful with :allow
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Permissions_Groups._prototype</span></span>
returns self so function can be chained
</ol>
</dd>
<dt>
<a name = "Permissions_Groups._prototype:is_allowed"></a>
<strong>Permissions_Groups._prototype:is_allowed (action)</strong>
</dt>
<dd>
Returns if an input action is allowed for this group
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">action</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.2/manual.html#6.4">string</a> or <span class="type">defines.input_action</span></span>
the action that you want to test for
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
true if the group is allowed the action, false other wise
</ol>
</dd>
<dt>
<a name = "Permissions_Groups._prototype:get_raw"></a>
<strong>Permissions_Groups._prototype:get_raw ()</strong>
</dt>
<dd>
Returns the LuaPermissionGroup that was created with this group object, used internally
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">LuaPermissionGroup</span></span>
the raw lua permission group
</ol>
</dd>
<dt>
<a name = "Permissions_Groups._prototype:create"></a>
<strong>Permissions_Groups._prototype:create ()</strong>
</dt>
<dd>
Creates or updates the permission group with the configured actions, used internally
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">LuaPermissionGroup</span></span>
the permission group that was created
</ol>
</dd>
<dt>
<a name = "Permissions_Groups._prototype:add_player"></a>
<strong>Permissions_Groups._prototype:add_player (player)</strong>
</dt>
<dd>
Adds a player to this group
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player</span>
<span class="types"><span class="type">LuaPlayer</span></span>
LuaPlayer the player you want to add to this group can be name or index etc
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
true if the player was added successfully, false other wise
</ol>
</dd>
<dt>
<a name = "Permissions_Groups._prototype:remove_player"></a>
<strong>Permissions_Groups._prototype:remove_player (player)</strong>
</dt>
<dd>
Removes a player from this group
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player</span>
<span class="types"><span class="type">LuaPlayer</span></span>
LuaPlayer the player you want to remove from this group can be name or index etc
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
true if the player was removed successfully, false other wise
</ol>
</dd>
<dt>
<a name = "Permissions_Groups._prototype:get_players"></a>
<strong>Permissions_Groups._prototype:get_players ([online])</strong>
</dt>
<dd>
Returns all player that are in this group with the option to filter to online/offline only
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">online</span>
<span class="types"><span class="type">boolean</span></span>
if nil returns all players, if true online players only, if false returns online players only
(<em>optional</em>)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
a table of players that are in this group; filtered if online param is given
</ol>
</dd>
<dt>
<a name = "Permissions_Groups._prototype:print"></a>
<strong>Permissions_Groups._prototype:print (message)</strong>
</dt>
<dd>
Prints a message to every player in this group
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">message</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
the message that you want to send to the players
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">number</span></span>
the number of players that received the message
</ol>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2019-05-29 22:30:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>