From c91a8c7061c83a33cca929859ea811afb985ac0a Mon Sep 17 00:00:00 2001 From: red-001 Date: Wed, 7 Jun 2017 08:09:06 +0100 Subject: [CSM] Add function to get player privileges (#5933) * [CSM] Add function to get player privileges + move related help functions to common * Added @Zeno- const --- doc/client_lua_api.md | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc') diff --git a/doc/client_lua_api.md b/doc/client_lua_api.md index 1375e1355..42d2bfbbf 100644 --- a/doc/client_lua_api.md +++ b/doc/client_lua_api.md @@ -730,6 +730,13 @@ Call these functions only at load time! * `minetest.localplayer` * Reference to the LocalPlayer object. See [`LocalPlayer`](#localplayer) class reference for methods. +### Privileges +* `minetest.get_privilege_list()` + * Returns a list of privileges the currect player has in the format `{priv1=true,...}` +* `minetest.string_to_privs(str)`: returns `{priv1=true,...}` +* `minetest.privs_to_string(privs)`: returns `"priv1,priv2,..."` + * Convert between two privilege representations + ### Client Environment * `minetest.get_player_names()` * Returns list of player names on server -- cgit v1.2.3