Skip to content

Commit

Permalink
Add privs check for all chatcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
MoNTE48 authored and luk3yx committed Jan 7, 2024
1 parent b7faf3e commit 4c79957
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions worldedit_commands/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ end


worldedit.register_command("about", {
privs = {},
privs = {worldedit=true},
params = "",
description = S("Get information about the WorldEdit mod"),
func = function(name)
Expand All @@ -286,7 +286,7 @@ worldedit.register_command("about", {

-- mostly copied from builtin/chatcommands.lua with minor modifications
worldedit.register_command("help", {
privs = {},
privs = {worldedit=true},
params = "[all/<cmd>]",
description = S("Get help for WorldEdit commands"),
parse = function(param)
Expand Down
2 changes: 2 additions & 0 deletions worldedit_commands/safe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ end)
minetest.register_chatcommand("/y", {
params = "",
description = "Confirm a pending operation",
privs = {worldedit=true},
func = function(name)
local callback = safe_region_callback[name]
if not callback then
Expand All @@ -74,6 +75,7 @@ minetest.register_chatcommand("/y", {
minetest.register_chatcommand("/n", {
params = "",
description = "Abort a pending operation",
privs = {worldedit=true},
func = function(name)
if not safe_region_callback[name] then
worldedit.player_notify(name, "no operation pending")
Expand Down

0 comments on commit 4c79957

Please sign in to comment.