Skip to content

Commit

Permalink
Add vote_kick privilege to grant access to kick voting
Browse files Browse the repository at this point in the history
  • Loading branch information
MinetestSam authored and rubenwardy committed Nov 20, 2018
1 parent def3b99 commit 2ae45bb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mods/vote/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,10 @@ minetest.after(5, vote.update_all_hud)

minetest.register_privilege("vote", {
description = "Can vote on issues",
basic_priv = true
})

minetest.register_privilege("vote_starter", {
description = "Can start votes on issues",
basic_priv = true
})

minetest.register_chatcommand("yes", {
Expand Down Expand Up @@ -311,10 +309,14 @@ minetest.register_chatcommand("abstain", {

local set = minetest.setting_get("vote.kick_vote")
if set == nil or minetest.is_yes(set) then
minetest.register_privilege("vote_kick", {
description = "Can (start) vote to kick a player",
})

minetest.register_chatcommand("vote_kick", {
privs = {
interact = true,
vote_starter = true
vote_kick = true,
},
func = function(name, param)
if not minetest.get_player_by_name(param) then
Expand Down

0 comments on commit 2ae45bb

Please sign in to comment.