> For the complete documentation index, see [llms.txt](https://libertycode.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://libertycode.gitbook.io/docs/lc_adminmenu/permissions.md).

# Permissions

## Permission Groups

The permission system in our admin menu is designed to be as flexible as possible. You can create custom permissions and set the default permission groups. Permission groups can also be viewed and edited from the UI. We created the permission group editor to make it easy to manage each group’s permissions and tiers.

{% embed url="<https://www.youtube.com/watch?v=9x54LX9qOqI>" %}

## How do I give myself permissions?

### CLI (Recommended)

The fastest way to give yourself access to the admin menu is through our CLI. Run `lc groups` to see all available groups, then use `lc give_access <server_id> <group_name>`.

You can check all CLI commands here: [CLI](/docs/lc_adminmenu/cli.md)

{% code title="Server Console" %}

```
> lc groups

[script:lc_adminmenu] --------------------------------------------------
[script:lc_adminmenu] Group Name | Tier | Discord Role ID | Non Editable
[script:lc_adminmenu] --------------------------------------------------
[script:lc_adminmenu] owner      | 1    | Not Set         | True        
[script:lc_adminmenu] admin      | 2    | Not Set         | True        
[script:lc_adminmenu] trial      | 10   | Not Set         | True        
[script:lc_adminmenu] --------------------------------------------------
[script:lc_adminmenu] Use command "lc group <group_name>" to see the permissions of a group.
[script:lc_adminmenu] Use command "lc create_group <group_name> <tier>" to create a new group.
[script:lc_adminmenu] Use command "lc delete_group <group_name>" to delete a group.

> lc give_access 5 owner
[script:lc_adminmenu] Admin menu access granted to 5 with group owner
```

{% endcode %}

### ACE Permissions

You can give yourself access to the admin menu by granting yourself ACE permissions. The ACE permission you need uses this format: `lc_adminmenu.<group_name>`. Make sure the group name is correct and that a permission group with that name exists.

{% code title="server.cfg" overflow="wrap" %}

```
add_ace identifier.license:YOUR_LICENSE lc_adminmenu.owner allow
```

{% endcode %}

### Framework Integration

To synchronize the admin menu group with group from the framework, you need to edit the config\_server.lua and set the Permissions.Framework to true

{% code title="config\_server.lua" expandable="true" %}

```lua
return {
  ...,
  Permissions = {
    UseDatabase = true,
    UseAcePerms = false,
    UseDiscord = false,
    UseFramework = true -- CHANGE THIS FROM FALSE TO TRUE
  }
}

```

{% endcode %}

| Framework | Command                       |
| --------- | ----------------------------- |
| ESX       | /setgroup \[id] \[group]      |
| QBCore    | /addpermission \[id] \[group] |
| qbx-core  | ACE permissions only          |

## Custom Permissions

You can add your own permissions and manage them from the admin panel.

> **Okay, but what's the point of adding more permissions?**

You can add custom functions to the admin menu, and then each function can be restricted by custom permission.

Custom permissions can be added in the `data/permissions.lua` file.

{% code title="data/permissions.lua " %}

```lua
---@class Permission
---@field label string
---@field name string
---@field linked_ace_permission? string | string[]

---@type Permission[]
return {
  ...,
  {
    label = 'Custom permission',
    name = 'custom_permission'
  }
}
```

{% endcode %}

Now restart the script and you are ready to use your newly added permissions.

<div align="left"><figure><img src="/files/gEaRWrBPuyA2uPKtz5dA" alt=""><figcaption></figcaption></figure></div>

## Linking ACE permissions

You can link ACE permissions to each Admin Menu permission, giving you tight control over what each admin can access. For example, you can restrict the `/revive` and `/heal` command so only admins with a permission group that includes the `revive` permission can use it.

{% code title="data/permissions.lua" %}

```lua
---@class Permission
---@field label string
---@field name string
---@field linked_ace_permission? string | string[]

---@type Permission[]
return {
  ...,
  {
    label = 'Revive',
    name = 'revive',
    linked_ace_permission = {
      'command.revive',
      'command.heal',
    }
  }
}
```

{% endcode %}
