summaryrefslogtreecommitdiff
path: root/builtin/game/privileges.lua
diff options
context:
space:
mode:
authorAuke Kok <sofar@foo-projects.org>2016-02-28 21:53:26 -0800
committerparamat <mat.gregory@virginmedia.com>2016-03-11 21:09:53 +0000
commitf627ef39e038089d977f4f671b11cd357b1dcd70 (patch)
treea2568c91d54690bfdb5a29ef7730d4a292fc9021 /builtin/game/privileges.lua
parentdc8bf4e9284bdc0b9367dc8dc23c394e7b5bde34 (diff)
downloadminetest-f627ef39e038089d977f4f671b11cd357b1dcd70.tar.gz
minetest-f627ef39e038089d977f4f671b11cd357b1dcd70.tar.bz2
minetest-f627ef39e038089d977f4f671b11cd357b1dcd70.zip
Introduce "protection_bypass" privilege.
This privilege allows map protection bypassing for server operators and world moderators. Initially I had thought that bypassing protection mods would have been something that could entirely be done inside mods and minetest_game, but the concept of protection is defined in core, in the code of core.is_protected(). I don't feel that it would be logical to introduce a protection concept in core, but not some way around that for server operators to maintain map parts that need fixing, de-griefing or cleanup. Others had noticed the same problems, and proposed a patch to minetest_game. That patch is fine by itself, but it fails to add protection bypass functionality for digging normal nodes and placing nodes. So, instead, we indroduce the new priv "protection_bypass" in core, and modify 'on_place_node' and 'node_dig' to allow bypassing node protections if the player holds this priv. This priv was tested with protector redo by tenplus1. A followup patch to Minetest Game will include allowing special checks for doors, trapdoors, chests in Minetest Game. Protection mods will likely want to mimic the changes in their relevant code sections.
Diffstat (limited to 'builtin/game/privileges.lua')
-rw-r--r--builtin/game/privileges.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/game/privileges.lua b/builtin/game/privileges.lua
index 7e6387c72..bd5ead624 100644
--- a/builtin/game/privileges.lua
+++ b/builtin/game/privileges.lua
@@ -32,6 +32,7 @@ core.register_privilege("settime", "Can use /time")
core.register_privilege("privs", "Can modify privileges")
core.register_privilege("basic_privs", "Can modify 'shout' and 'interact' privileges")
core.register_privilege("server", "Can do server maintenance stuff")
+core.register_privilege("protection_bypass", "Can bypass node protection in the world")
core.register_privilege("shout", "Can speak in chat")
core.register_privilege("ban", "Can ban and unban players")
core.register_privilege("kick", "Can kick players")