Skip to content

Conversation

@Zuntie
Copy link

@Zuntie Zuntie commented Oct 27, 2025

Description

Adds support for configuring command permissions from a configuration file (es_extended/server/config/commandperms.lua). ESX.RegisterCommand now reads the configured permission group (if any) for a command and enforces it. Backwards compatibility with the existing API is preserved.


Motivation

Easier management of which groups can use which commands. - also without introducing breaking changes.


Implementation Details

Its implemented by editing the ESX.RegisterCommand function. The function now checks if a group has been set in the configuration file. It also maintains backwards compatibility
If the group argument is false, it will now check the configuration for its permitted groups.


Usage Example

Both are correct and work, as backwards compatibility is retained.

New API

-- es_extended/server/config/commandperms.lua:
["setcoords"] = { "admin" },
    
-- Wherever
ESX.RegisterCommand("setcoords", false, function(xPlayer, args)
    -- command
end, false, {
    help = "...",
    arguments = {...}
})

Old API

ESX.RegisterCommand("setcoords", "admin", function(xPlayer, args)
    -- command
end, false, {
    help = "...",
    arguments = {...}
})

Note

Please do check if the type annotations are correct.


PR Checklist

  • My commit messages and PR title follow the Conventional Commits standard.
  • My changes have been tested locally and function as expected.
  • My PR does not introduce any breaking changes.
  • I have provided a clear explanation of what my PR does, including the reasoning behind the changes and any relevant context.

@N0tNvll N0tNvll requested review from Kr3mu and Zykem October 28, 2025 01:51
@CLAassistant
Copy link

CLAassistant commented Nov 16, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants