mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-29 01:01:24 +00:00
feat(permission/playerdata): system admin permission
This commit is contained in:
+1
-1
@@ -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 = {}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user