# Permissions

Permissions determine who has access to specific banners and what they can do with them. They are crucial for ensuring that banners are used appropriately and that sensitive information is protected.

## How it works?

Path: **rcore\_banners/configs/permissions.lua**

Our resource is using permissions based of user group.

We have already premade groups for ESX/QBCore used groups.

* QBCore: god, admin
* ESX: superadmin, admin

**Structure of permissions**

```lua
Config.Permissions = {
    Groups = {
        ['superadmin'] = {
            [WORKSTATION_PERMS.CAN_SET_BANNER] = true,
            [WORKSTATION_PERMS.CAN_PRODUCE_BANNER] = true,
            [WORKSTATION_PERMS.CAN_UPDATE_TARGET_BATCH] = true,
            [WORKSTATION_PERMS.CAN_STOP_TARGET_PRODUCTION] = true,

            [WORKSTATION_PERMS.ACCESS_WORKSTATION_CUSTOM] = true,
            [WORKSTATION_PERMS.ACCESS_WORKSTATION_BANNER_CREATION] = true,
            [WORKSTATION_PERMS.ACCESS_WORKSTATION_MANAGEMENT] = true,

            [APP_PERMS.ACCESS_CUSTOM_BANNER] = true,
            [APP_PERMS.ACCESS_ARCHIVE_BANNER] = true,
        },
        ['god'] = {
            [WORKSTATION_PERMS.CAN_SET_BANNER] = true,
            [WORKSTATION_PERMS.CAN_PRODUCE_BANNER] = true,
            [WORKSTATION_PERMS.CAN_UPDATE_TARGET_BATCH] = true,
            [WORKSTATION_PERMS.CAN_STOP_TARGET_PRODUCTION] = true,
            
            [WORKSTATION_PERMS.ACCESS_WORKSTATION_CUSTOM] = true,
            [WORKSTATION_PERMS.ACCESS_WORKSTATION_BANNER_CREATION] = true,
            [WORKSTATION_PERMS.ACCESS_WORKSTATION_MANAGEMENT] = true,

            [APP_PERMS.ACCESS_CUSTOM_BANNER] = true,
            [APP_PERMS.ACCESS_ARCHIVE_BANNER] = true,
        },
        ['admin'] = {
            [APP_PERMS.ACCESS_CUSTOM_BANNER] = true,
            [APP_PERMS.ACCESS_ARCHIVE_BANNER] = true,
        }
    }
}
```

## Type of permissions

### Dashboard

All permission related to rcore\_banners dashboard UI (/banners)

#### APP\_PERMS\_ACCESS\_CUSTOM\_BANNER

<pre><code><strong>APP_PERMS_ACCESS_CUSTOM_BANNER
</strong></code></pre>

* Player with this permission is allow to create new server global banners.

#### APP\_PERMS\_ACCESS\_ARCHIVE\_BANNER

```
APP_PERMS_ACCESS_ARCHIVE_BANNER
```

* Player with this permission is allow to access archive page, where all banners stored with options to restore them or delete them from server.

### Work stations (printers)

All permissions related to rcore\_banners business (stations).

```
WORKSTATION_PERMS.CAN_PRODUCE_BANNER
```

* Player with this permission is allowed to produce banner at work station.

```
WORKSTATION_PERMS.CAN_SET_BANNER
```

* Player with this permission is allowed to what banner is going to be produced on specific printer which players is at.

```lua
WORKSTATION_PERMS.CAN_UPDATE_TARGET_BATCH
```

* Player with this permission is allowed to update batch of active printer with specific amount which he desire.

```lua
WORKSTATION_PERMS.CAN_STOP_TARGET_PRODUCTION
```

* Player with this permission is allowed to stop current active production of banner if its active.

```
WORKSTATION_PERMS.ACCESS_WORKSTATION_CUSTOM
```

* Player with this permission is allowed to open page where he can create new business banner.

```
WORKSTATION_PERMS.ACESS_WORKSTATION_MANAGEMENT
```

* Player with this permission is allowed to to access work station management menu.
