mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-29 01:01:24 +00:00
tweak: HasPermissions accept both string and table
Enables single and multiple permission checks
This commit is contained in:
@@ -357,7 +357,14 @@ end
|
||||
|
||||
function QBCore.Functions.HasPermission(source, permission)
|
||||
local src = source
|
||||
if IsPlayerAceAllowed(src, permission) then return true end
|
||||
if type(permission) == "string" then
|
||||
if IsPlayerAceAllowed(src, permission) then return true end
|
||||
elseif type(permission) == "table" then
|
||||
for _, permLevel in pairs(permission) do
|
||||
if IsPlayerAceAllowed(src, permLevel) then return true end
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user