# Custom Permissions (ACE)

{% hint style="info" %}
Alternative Permissions must be disabled in config to make this work
{% endhint %}

{% code overflow="wrap" fullWidth="true" %}

```lua
-- Server-Side

ExecuteCommand("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",
        "ESPAccess",
        "ClearEntitiesAccess",
        "BanAndKickAccess",
        "GotoAndBringAccess",
        "VehicleAccess",
        "MiscAccess",
        "LogsAccess",
        "PlayerSelectorAccess",
        "BanListAndUnbanAccess",
        "ModelChangerAccess",
        --[[ Client ]] --
        "BypassSpectate",
        "BypassGodMode",
        "BypassInvisible",
        "BypassStealOutfit",
        "BypassInfStamina",
        "BypassNoclip",
        "BypassSuperJump",
        "BypassFreecam",
        "BypassSpeedHack",
        "BypassTeleport",
        "BypassNightVision",
        "BypassThermalVision",
        "BypassOCR",
        "BypassNuiDevtools",
        "BypassBlacklistedTextures",
        "BlipsBypass",
        "BypassCbScanner",
        --[[ Weapon ]] --
        "BypassWeaponDmgModifier",
        "BypassInfAmmo",
        "BypassNoReload",
        "BypassRapidFire",
        --[[ Vehicle ]] --
        "BypassVehicleFixAndGodMode",
        "BypassVehicleHandlingEdit",
        "BypassVehicleModifier",
        "BypassBulletproofTires",
        --[[ Blacklist ]] --
        "BypassModelChanger",
        "BypassWeaponBlacklist",
        --[[ Misc ]] --
        "FGCommands",
        "BypassVPN",
        "BypassExplosion",
        "BypassClearTasks",
        "BypassParticle"
    },
    supporter = {
        "BypassSpectate"
    }
}

for groupName, permissionsObject in pairs(permissionsGroups) do
    for _, permissionValue in ipairs(permissionsObject) do
        ExecuteCommand("add_ace group." .. groupName .. "_FgGroup " .. permissionValue .. " allow")
    end
end

-- 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 identifier
AddEventHandler("yourEventToHandlePermissions", function(playerId, group)
    ExecuteCommand("add_principal identifier." .. GetPlayerIdentifier(playerId, 0) .. " group." .. group .. "_FGGroup")
end)
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fiveguard.net/permission-system/custom-permissions-ace.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
