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
+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