From 16f6ef1de70c765a1e9a3a06162ff5f8025fa63b Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Tue, 29 Aug 2017 01:29:04 +0100 Subject: [PATCH] Privileges: Update outdated basic_privs section --- en/chapters/privileges.md | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/en/chapters/privileges.md b/en/chapters/privileges.md index d3d772b..b334ee4 100644 --- a/en/chapters/privileges.md +++ b/en/chapters/privileges.md @@ -127,32 +127,18 @@ minetest.set_player_privs(name, privs) ## Adding privileges to basic_privs -
-

Workaround / PR pending

+`basic_privs` is a privilege that allows a player to only grant certain privileges. +It's common to give this privilege to moderators so they can grant and revoke +interact and shout, but can't give themselves or other players any bigger +privileges such as giveme and server. - This is a workaround for a missing feature. - I have submitted a - pull request / patch - to make it so you don't need to edit builtin to add a priv to basic_privs. -
+To add a privilege to basic_privs, you need to change the basic_privs setting +to include any privs you wish. -To allow people with basic_privs to grant and revoke your priv, you'll -need to edit [builtin/game/chatcommands.lua](https://github.com/minetest/minetest/blob/master/builtin/game/chatcommands.lua#L164-L252): +By default basic_privs has the following value: -In both grant and revoke, change the following if statement: + basic_privs = interact, shout -{% highlight lua %} -if priv ~= "interact" and priv ~= "shout" and - not core.check_player_privs(name, {privs=true}) then - return false, "Your privileges are insufficient." -end -{% endhighlight %} +And then you can add vote as so: -For example, to add vote: - -{% highlight lua %} -if priv ~= "interact" and priv ~= "shout" and priv ~= "vote" and - not core.check_player_privs(name, {privs=true}) then - return false, "Your privileges are insufficient." -end -{% endhighlight %} + basic_privs = interact, shout, vote