Privileges: Update outdated basic_privs section
This commit is contained in:
parent
00258a247d
commit
16f6ef1de7
@ -127,32 +127,18 @@ minetest.set_player_privs(name, privs)
|
|||||||
|
|
||||||
## Adding privileges to basic_privs
|
## Adding privileges to basic_privs
|
||||||
|
|
||||||
<div class="notice">
|
`basic_privs` is a privilege that allows a player to only grant certain privileges.
|
||||||
<h2>Workaround / PR pending</h2>
|
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.
|
To add a privilege to basic_privs, you need to change the basic_privs setting
|
||||||
I have submitted a
|
to include any privs you wish.
|
||||||
<a href="https://github.com/minetest/minetest/pull/3976">pull request / patch</a>
|
|
||||||
to make it so you don't need to edit builtin to add a priv to basic_privs.
|
|
||||||
</div>
|
|
||||||
|
|
||||||
To allow people with basic_privs to grant and revoke your priv, you'll
|
By default basic_privs has the following value:
|
||||||
need to edit [builtin/game/chatcommands.lua](https://github.com/minetest/minetest/blob/master/builtin/game/chatcommands.lua#L164-L252):
|
|
||||||
|
|
||||||
In both grant and revoke, change the following if statement:
|
basic_privs = interact, shout
|
||||||
|
|
||||||
{% highlight lua %}
|
And then you can add vote as so:
|
||||||
if priv ~= "interact" and priv ~= "shout" and
|
|
||||||
not core.check_player_privs(name, {privs=true}) then
|
|
||||||
return false, "Your privileges are insufficient."
|
|
||||||
end
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
For example, to add vote:
|
basic_privs = interact, shout, 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 %}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user