Permission System

Custom Permissions (ACE)

How to implement custom permissions that apply FiveGuard permissions to a player

Alternative Permissions must be disabled in config to make this work

-- Server-SideExecuteCommand("add_ace group.bypassPermGroup command allow")ExecuteCommand("add_principal resource." .. GetCurrentResourceName() .. " group.bypassPermGroup")local permissionsGroups = { -- Permissions that'll be set to true for specific player    admin = {        --[[ AdminMenu ]] --        "AdminMenuAccess",        "AnnouncementAccess",        "VisualsAccess",        "EntityCleanupAccess",        "PlayerModerationAccess",        "PlayerTeleportAccess",        "VehicleAccess",        "SelfAccess",        "QuickTeleportAccess",        "WorldAccess",        "WeaponAccess",        "PlayersAccess",        "PlayerManagementAccess",        "SpectateAccess",        "ScreenshotAccess",        "MonitorAccess",        "OfflinePlayersAccess",        "FreecamAccess",        "LogsAccess",        "PlayerSelectorAccess",        "BanListAccess",        "PedModelsAccess",        --[[ Client ]] --        "BypassSpectate",        "BypassGodMode",        "BypassInvisible",        "BypassStealOutfit",        "BypassInfStamina",        "BypassNoclip",        "BypassSuperJump",        "BypassFreecam",        "BypassSpeedHack",        "BypassTeleport",        "BypassNightVision",        "BypassThermalVision",        "BypassExplosiveAmmo",        "BypassOCR",        "BypassNuiDevtools",        "BypassBlacklistedTextures",        "BlipsBypass",        "BypassCbScanner",        "BypassSpoofedBulletShot",        --[[ Weapon ]] --        "BypassWeaponDmgModifier",        "BypassInfAmmo",        "BypassNoReload",        "BypassRapidFire",        --[[ Vehicle ]] --        "BypassVehicleFixAndGodMode",        "BypassVehicleHandlingEdit",        "BypassVehicleModifier",        "BypassBulletproofTires",        "BypassVehiclePlateChanger",        --[[ Blacklist ]] --        "BypassModelChanger",        "BypassWeaponBlacklist",        --[[ Misc ]] --        "FGCommands",        "BypassVPN",        "BypassExplosion",        "BypassClearTasks",        "BypassParticle",        "BypassSpoofedWeapons"    },    supporter = {        "BypassSpectate"    }}for groupName, permissionsObject in pairs(permissionsGroups) do    for _, permissionValue in ipairs(permissionsObject) do        ExecuteCommand("add_ace group." .. groupName .. "_FgGroup " .. permissionValue .. " allow")    endend-- this event must be triggered before player is loaded to server, for example on player joining event, your code should handle permission setup and run the command "add_principal" to assign ACE group to player identifierAddEventHandler("yourEventToHandlePermissions", function(playerId, group)    ExecuteCommand("add_principal identifier." .. GetPlayerIdentifier(playerId, 0) .. " group." .. group .. "_FgGroup")end)