> For the complete documentation index, see [llms.txt](https://docs.av-scripts.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.av-scripts.com/laptop-pack-v3/racing/installation/permissions.md).

# Permissions

> This permissions functions are located in **server/editable/permissions.lua**

> This file allows you to configure specific permissions, including the ability to create events and new tracks.
>
> Both functions must return a Boolean (true/false) indicating whether the user has access to the feature.
>
> Each function has its own permissions check:
>
> * **isAdmin(playerId)** = Returns true/false if player is Admin, using the Fivem ACE Permissions native.
> * **createTracks table** = There's a table in the same file, where you can add your players Framework identifier and/or Rockstar License to allow them to use the function.

<figure><img src="/files/U3MFshF5e62zgDXBLCXE" alt=""><figcaption></figcaption></figure>

{% tabs %}
{% tab title="Create Tracks" %}

> This permission allows the player to register new circuits.

```lua
function CanCreateTracks(playerId,laptopSerial) -- Player can create new tracks, return true/false
    dbug("CanCreateTracks(playerId, laptopSerial)", playerId, laptopSerial)
    local res = isAdmin(playerId) -- run the default admin check
    if res then return true end -- if player is admin return true, no need to run any extra code

    local characterIdentifier = exports['av_laptop']:getIdentifier(playerId) -- Character Framework identifier
    local license = GetPlayerIdentifierByType(playerId, "license") -- Player rockstar license
    if createTracks[characterIdentifier] or createTracks[license] then
        return true
    end
    -- EXAMPLE CHECKING IF PLAYER HAVE X ITEM
    -- Will return true/false if player have item gold_dongle with him
    --[[
        return exports['av_laptop']:hasItem(playerId, "gold_dongle")
    ]]--

    -- EXAMPLE CHECKING IF LAPTOP CONTAINER HAVE X ITEM, ONLY WORKS WITH ox and origen inventory !
    --[[
        return exports['av_laptop']:hasDevice(laptopSerial, "gold_dongle")
    ]]--
    return false
end
```

{% endtab %}

{% tab title="Create Events" %}

> This permission allows players to create new events.

```lua
function CanCreateRaces(playerId,laptopSerial) -- Player can create new events (races), return true/false
    dbug("CanCreateRaces(playerId, laptopSerial)", playerId, laptopSerial)
    local res = isAdmin(playerId) -- run the default admin check
    if res then return true end -- if player is admin return true, no need to run any extra code

    local characterIdentifier = exports['av_laptop']:getIdentifier(playerId) -- Character Framework identifier
    local license = GetPlayerIdentifierByType(playerId, "license") -- Player rockstar license
    if createEvents[characterIdentifier] or createEvents[license] then
        return true
    end
    -- EXAMPLE CHECKING IF PLAYER HAVE X ITEM
    -- Will return true/false if player have item gold_dongle with him
    --[[
        return exports['av_laptop']:hasItem(playerId, "gold_dongle")
    ]]--

    -- EXAMPLE CHECKING IF LAPTOP CONTAINER HAVE X ITEM, ONLY WORKS WITH ox and origen inventory !
    --[[
        return exports['av_laptop']:hasDevice(laptopSerial, "gold_dongle")
    ]]--
    return false
end
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.av-scripts.com/laptop-pack-v3/racing/installation/permissions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
