From cc44840df40c220a552fac49ebbd1e7e52915dc5 Mon Sep 17 00:00:00 2001 From: Kakarot <57848836+GhzGarage@users.noreply.github.com> Date: Mon, 28 Mar 2022 21:37:53 -0500 Subject: [PATCH] GetPermission function --- server/functions.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/functions.lua b/server/functions.lua index fb0cfa4..fcad125 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -292,6 +292,16 @@ function QBCore.Functions.HasPermission(source, permission) return false end +function QBCore.Functions.GetPermission(source) + local src = source + for k,v in pairs (QBConfig.Server.Permissions) do + if IsPlayerAceAllowed(src, 'group.'..v) then + return v + end + end + return 'user' +end + -- Opt in or out of admin reports -- function QBCore.Functions.IsOptin(source)