aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorrubenwardy <rubenwardy@gmail.com>2017-08-26 07:17:05 +0100
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-08-26 08:17:05 +0200
commit096ea031de5bdb3e51d2ceb12e6b7e2f2053081e (patch)
tree299fa6f103e70c091cbd73c221046ec2fc302d35 /doc
parentad9677a14fb8ad1b4048e83a779e5ad36a99f2d0 (diff)
downloadhax-minetest-server-096ea031de5bdb3e51d2ceb12e6b7e2f2053081e.tar.gz
hax-minetest-server-096ea031de5bdb3e51d2ceb12e6b7e2f2053081e.zip
Add on_grant and on_revoke callbacks (#4713)
* Add register_on_priv_grant/revoke, and on_grant/revoke to privs. Call from /grant and /revoke * Call on_grant and on_revoke callbacks from set_privs
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 5b071d626..6ff9c9433 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -2446,6 +2446,12 @@ Call these functions only at load time!
* `definition`: `{ description = "description text", give_to_singleplayer = boolean}`
the default of `give_to_singleplayer` is true
* To allow players with `basic_privs` to grant, see `basic_privs` minetest.conf setting.
+ * `on_grant(name, granter_name)`: Called when given to player `name` by `granter_name`.
+ `granter_name` will be nil if the priv was granted by a mod.
+ * `on_revoke(name, revoker_name)`: Called when taken from player `name` by `revoker_name`.
+ `revoker_name` will be nil if the priv was revoked by a mod
+ * Note that the above two callbacks will be called twice if a player is responsible -
+ once with the player name, and then with a nil player name.
* `minetest.register_authentication_handler(handler)`
* See `minetest.builtin_auth_handler` in `builtin.lua` for reference