tweak: HasPermissions accept both string and table

Enables single and multiple permission checks
This commit is contained in:
Spudgun
2022-08-24 18:57:53 +12:00
parent 1dde823486
commit c61d0b204e
+8 -1
View File
@@ -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