1
0
mirror of https://github.com/Uberi/Minetest-WorldEdit.git synced 2025-07-04 17:10:36 +02:00

Require the "server" privilege for commands that write to files (but not

for reads)
Inconsistently require the "worldedit" privilege, based on creative mode
and the existence of a land ownership mod.
This commit is contained in:
khonkhortisan
2014-04-16 18:54:16 -07:00
parent f2436db108
commit ae5a7376c0
2 changed files with 46 additions and 46 deletions

View File

@ -9,17 +9,17 @@ minetest.after(0, function()
--worldedit privilege is permission to edit everything
end)
--this is privs= within chatcommands that actually change land
--this is privs={worldedit=this()} within chatcommands that actually change land
--(should be the same functions as safe_region)
function worldedit.get_privs()
function worldedit.priv()
if not PROTECTION_MOD_EXISTS or not minetest.setting_getbool("creative_mode") then
--no protection mod, or not the kind of world where people can just create nodes out of thin air,
--worldedit privilege means editing anywhere
return {worldedit=true}
return true
end
--protection mod, can edit inside your area without worldedit privilege
--(worldedit and areas let you edit in no-man's land and other-owned area)
return {worldedit=false} -- this array could also be empty
return false
end
function worldedit.can_edit_volume(name)