diff options
author | AFCMS <61794590+AFCMS@users.noreply.github.com> | 2021-06-30 20:40:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-30 20:40:45 +0200 |
commit | 8cc04e0cb4fb186092732c7687543f67b4628c96 (patch) | |
tree | f359a04fe9c45ad080c0fa1000bde8d4a9c00336 /builtin/game/auth.lua | |
parent | f2fd4432625ee5cf0380bdd006cd1f15d053b12f (diff) | |
download | minetest-8cc04e0cb4fb186092732c7687543f67b4628c96.tar.xz |
Run on_grant and on_revoke callbacks after privs change (#11387)
Callbacks were run too early. This changes the order to call after the privs are updated.
Diffstat (limited to 'builtin/game/auth.lua')
-rw-r--r-- | builtin/game/auth.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/builtin/game/auth.lua b/builtin/game/auth.lua index fc061666c..e7d502bb3 100644 --- a/builtin/game/auth.lua +++ b/builtin/game/auth.lua @@ -87,6 +87,10 @@ core.builtin_auth_handler = { core.settings:get("default_password"))) end + auth_entry.privileges = privileges + + core_auth.save(auth_entry) + -- Run grant callbacks for priv, _ in pairs(privileges) do if not auth_entry.privileges[priv] then @@ -100,9 +104,6 @@ core.builtin_auth_handler = { core.run_priv_callbacks(name, priv, nil, "revoke") end end - - auth_entry.privileges = privileges - core_auth.save(auth_entry) core.notify_authentication_modified(name) end, reload = function() |