feat(permission/playerdata): system admin permission

This commit is contained in:
BerkieBb
2022-02-24 22:13:30 +01:00
parent 31888996ab
commit c3f114b381
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ QBConfig.Server.pvp = true -- Enable or disable pvp on the server (Ability to sh
QBConfig.Server.discord = "" -- Discord invite link
QBConfig.Server.checkDuplicateLicense = true -- Check for duplicate rockstar license on join
QBConfig.Server.PermissionList = {} -- Permission list for old permission system
QBConfig.Server.UseOldPermissionSystem = true -- Use old permissions system from the database
QBConfig.Server.UseOldPermissionSystem = false -- Use old permissions system from the database
QBConfig.Server.AllPermissions = {'god',} -- Table of permissions which have access to everything
QBConfig.Notify = {}
+3
View File
@@ -46,6 +46,9 @@ function QBCore.Player.CheckPlayerData(source, PlayerData)
if not QBCore.Config.Server.UseOldPermissionSystem then
if PlayerData.permission then ExecuteCommand(('remove_principal identifier.%s group.%s'):format(PlayerData.license, PlayerData.permission)) end
PlayerData.permission = PlayerData.permission or 'user'
if IsPlayerAceAllowed(source, 'command') and IsPlayerAceAllowed(source, 'webadmin') then -- if both are true then the person has group.admin and is a system admin
PlayerData.permission = QBCore.Config.Server.AllPermissions[1] or 'god'
end
ExecuteCommand(('add_principal identifier.%s group.%s'):format(PlayerData.license, PlayerData.permission))
PlayerData.optin = PlayerData.optin or true
end