liveBase API System
Central Permission API, state manager, exports, hot reload, and script integration.
🌐 Türkçe · liveBase API System
Central API documentation. All livedev scripts use the liveBase Permission API and
export layer.
Permission API
Central permission system. Scripts use Framework.HasPermission instead of writing
their own ACE checks.
How it works
Framework.HasPermission(source, 'admin.giveitem')
│
├─ Console (source=0) → always true
├─ God role → always true
├─ ACE: livebase.admin.giveitem → IsPlayerAceAllowed
└─ Config.Permissions.Grants fallback → role list (god, admin, mod)ACE prefix: livebase (config/permissions.lua → AcePrefix)
Roles: god (100), admin (80), mod (50)
Server usage
if exports['liveBase']:HasPermission(source, 'admin.ban') then end
local Framework = exports['liveBase']:GetFramework()
if Framework.HasPermission(source, 'admin.kick') then end
if liveBase.Functions.HasPermission(source, 'admin.givemoney') then endBridge functions
After loading @liveBase/shared/permission_bridge.lua:
if LiveHasPermission(source, 'admin.weather') then end
if not LiveRequirePermission(source, 'admin.giveitem', QBCore.Functions.Notify) then
return
end
LiveRegisterDevCommand('openFirstScreen', 'dev.firstscreen', function()
openFirstScreenUi()
end)Permission exports
| Export | Side | Description |
|---|---|---|
HasPermission(source, permission) | Server | Permission check |
GetFramework() | Server | Permission API object |
RegisterPermission(permission, roles) | Server | Runtime permission registration |
GetPlayerRoles(source) | Server | Player roles |
Defined permissions
| Permission | Roles | Description |
|---|---|---|
admin.ban | god, admin | Ban player |
admin.giveitem | god, admin | Give item |
admin.clearinv | god, admin | Clear inventory |
admin.weather | god, admin | Weather/time commands |
admin.hotreload | god, admin | Hot reload |
dev.firstscreen | god, admin | openFirstScreen debug |
dev.charselect | god, admin | openCharacterMenu debug |
server.closed | god | Closed server bypass |
Full list in Turkish docs — same keys in config/permissions.lua.
Permission Bridge (Script Integration)
All [livedev] scripts include @liveBase/shared/permission_bridge.lua.
New script integration
server_scripts {
'@liveBase/shared/permission_bridge.lua',
'server/main.lua',
}RegisterNetEvent('myScript:server:adminAction', function()
local src = source
if not LiveRequirePermission(src, 'admin.custom', liveBase.Functions.Notify) then return end
end)Global State Manager
Namespace-based central state. Key format: lb:<namespace>:<key>
Module: config/modules.lua → state = true
Server
exports['liveBase']:SetGlobalState('weather', 'mode', 'rain')
exports['liveBase']:SetPlayerState(source, 'gameplay', 'cuffed', true)Client
local mode = exports['liveBase']:GetGlobalState('weather', 'mode')
exports['liveBase']:SetLocalState('ui', 'menuOpen', true)liveBase Exports (summary)
See liveBase Core for the full export list.
Key exports: GetBaseObject(), HasPermission(), HotReload(), RunMigrations(),
GetSkillTreeSnapshot(), Notify(), RegisterInteraction()
Hot Reload API
exports['liveBase']:HotReload('inventory')
exports['liveBase']:GetHotReloadAliases()| Alias | Resource |
|---|---|
inventory / inv | liveInventory |
target | liveTarget |
weather | liveWeatherSync |
charselect | liveCharacterSelect |
Script-based permissions
liveInventory
| Command | Permission |
|---|---|
/giveitem | admin.giveitem |
/clearinv | admin.clearinv |
/itemmenu | admin.itemmenu |
liveWeatherSync
All weather/time commands require admin.weather.
ACE configuration
add_ace livebase.god god allow
add_ace livebase.admin admin allow
add_ace livebase.mod mod allow
add_principal identifier.license:XXXXXXXX livebase.god
add_ace identifier.license:ZZZZZZZZ livebase.admin.giveitem allowDisable module: Config.Modules.permissions = false