Skip to content

Instantly share code, notes, and snippets.

@appgurueu
Last active January 22, 2024 21:00
Show Gist options
  • Save appgurueu/3dd56692814532d61caa02c941fa691b to your computer and use it in GitHub Desktop.
Save appgurueu/3dd56692814532d61caa02c941fa691b to your computer and use it in GitHub Desktop.
Fix revoke callbacks being run for `false` values passed to `set_privileges`
diff --git a/builtin/game/auth.lua b/builtin/game/auth.lua
index fa1860d5d..932021a0e 100644
--- a/builtin/game/auth.lua
+++ b/builtin/game/auth.lua
@@ -101,7 +101,7 @@ core.builtin_auth_handler = {
-- Run revoke callbacks
for priv, _ in pairs(prev_privs) do
- if not privileges[priv] then
+ if privileges[priv] == nil then
core.run_priv_callbacks(name, priv, nil, "revoke")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment