summaryrefslogtreecommitdiff
path: root/builtin/game
diff options
context:
space:
mode:
authorDorian Wouters <elementw@openmailbox.org>2016-12-31 18:12:26 +0100
committerest31 <est31@users.noreply.github.com>2016-12-31 18:12:26 +0100
commita1346c916e1d0f0cde2ccecc680857896c717a3d (patch)
tree98c948ffdab135e2a3e9658acb1b47136c0f6834 /builtin/game
parentdd3cda6bedf0ed7443258f33d5a5cf68fa120534 (diff)
downloadminetest-a1346c916e1d0f0cde2ccecc680857896c717a3d.tar.gz
minetest-a1346c916e1d0f0cde2ccecc680857896c717a3d.tar.bz2
minetest-a1346c916e1d0f0cde2ccecc680857896c717a3d.zip
Fix /grant & /revoke not working with custom auth handler (#4974)
core.auth_table is not supposed to be accessed directly.
Diffstat (limited to 'builtin/game')
-rw-r--r--builtin/game/chatcommands.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/game/chatcommands.lua b/builtin/game/chatcommands.lua
index 2bd93855b..71edeb26a 100644
--- a/builtin/game/chatcommands.lua
+++ b/builtin/game/chatcommands.lua
@@ -162,7 +162,7 @@ local function handle_grant_command(caller, grantname, grantprivstr)
return false, "Your privileges are insufficient."
end
- if not core.auth_table[grantname] then
+ if not core.get_auth_handler().get_auth(grantname) then
return false, "Player " .. grantname .. " does not exist."
end
local grantprivs = core.string_to_privs(grantprivstr)
@@ -232,7 +232,7 @@ core.register_chatcommand("revoke", {
local revoke_name, revoke_priv_str = string.match(param, "([^ ]+) (.+)")
if not revoke_name or not revoke_priv_str then
return false, "Invalid parameters (see /help revoke)"
- elseif not core.auth_table[revoke_name] then
+ elseif not core.get_auth_handler().get_auth(revoke_name) then
return false, "Player " .. revoke_name .. " does not exist."
end
local revoke_privs = core.string_to_privs(revoke_priv_str)