fix(server/commands.lua/events.lua): Perms

- Wrong native was used for checking ace perms which allowed all to use them. Should be resolved.
This commit is contained in:
GhzGarage
2021-09-25 18:04:35 -05:00
parent f07fbbcf81
commit f2414d0275
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ function QBCore.Commands.Refresh(source)
for command, info in pairs(QBCore.Commands.List) do
local isGod = QBCore.Functions.HasPermission(src, 'god')
local hasPerm = QBCore.Functions.HasPermission(src, QBCore.Commands.List[command].permission)
local isPrincipal = IsPrincipalAceAllowed('group.admin', 'command')
local isPrincipal = IsPlayerAceAllowed(src, 'command')
if isGod or hasPerm or isPrincipal then
suggestions[#suggestions+1] = {
name = '/' .. command,
+2 -2
View File
@@ -21,7 +21,7 @@ AddEventHandler('chatMessage', function(source, n, message)
if Player then
local isGod = QBCore.Functions.HasPermission(src, 'god')
local hasPerm = QBCore.Functions.HasPermission(src, QBCore.Commands.List[command].permission)
local isPrincipal = IsPrincipalAceAllowed('group.admin', 'command')
local isPrincipal = IsPlayerAceAllowed(src, 'command')
table.remove(args, 1)
if isGod or hasPerm or isPrincipal then
if (QBCore.Commands.List[command].argsrequired and #QBCore.Commands.List[command].arguments ~= 0 and args[#QBCore.Commands.List[command].arguments] == nil) then
@@ -196,7 +196,7 @@ RegisterNetEvent('QBCore:CallCommand', function(command, args)
if Player then
local isGod = QBCore.Functions.HasPermission(src, 'god')
local hasPerm = QBCore.Functions.HasPermission(src, QBCore.Commands.List[command].permission)
local isPrincipal = IsPrincipalAceAllowed('group.admin', 'command')
local isPrincipal = IsPlayerAceAllowed(src, 'command')
if (QBCore.Commands.List[command].permission == Player.PlayerData.job.name) or isGod or hasPerm or isPrincipal then
if (QBCore.Commands.List[command].argsrequired and #QBCore.Commands.List[command].arguments ~= 0 and args[#QBCore.Commands.List[command].arguments] == nil) then
TriggerClientEvent('QBCore:Notify', src, 'All arguments must be filled out!', 'error')