From 4a22b68511796c8252b4d70bd142c747f6739e9a Mon Sep 17 00:00:00 2001 From: Ihsan <122683406+rwixy@users.noreply.github.com> Date: Sat, 8 Aug 2026 00:16:03 +0530 Subject: [PATCH] refactor(commands): simplify group filtering and update deprecation notice for AdminGroups --- [core]/es_extended/server/modules/commands.lua | 8 +------- [core]/es_extended/shared/config/main.lua | 3 +++ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/[core]/es_extended/server/modules/commands.lua b/[core]/es_extended/server/modules/commands.lua index 0a800f7a..0542d3f9 100644 --- a/[core]/es_extended/server/modules/commands.lua +++ b/[core]/es_extended/server/modules/commands.lua @@ -1,13 +1,7 @@ local CommandPermissions = Config.CommandPermissions or {} local function FilterGroups(groups) - local filtered = {} - for _, group in ipairs(groups or {}) do - if Config.AdminGroups[group] ~= false then - filtered[#filtered + 1] = group - end - end - return #filtered > 0 and filtered or { "admin" } + return (groups and #groups > 0) and groups or { "user" } end ESX.RegisterCommand( diff --git a/[core]/es_extended/shared/config/main.lua b/[core]/es_extended/shared/config/main.lua index 2c32180b..f61ff88c 100644 --- a/[core]/es_extended/shared/config/main.lua +++ b/[core]/es_extended/shared/config/main.lua @@ -34,6 +34,9 @@ Config.DefaultSpawns = { -- If you want to have more spawn positions and select --{x = 233.5459, y = -868.2626, z = 30.2922, heading = 1.0} } +---@deprecated Use `Config.CommandPermissions` as the single source of truth for command ACLs. +--- Kept temporarily for backwards compatibility with external resources that still read `Config.AdminGroups`. +--- Will be removed in ESX 1.15. Config.AdminGroups = { ["owner"] = true, ["admin"] = true,