# Client Exports

### openBossMenu

Opening the company / gang boss menu

```lua
---@param {name: string}: Job / gang name e.g. 'police', 'mechanic', 'ballas'
---@param {type: string}: 'job' or 'gang'
exports['vms_bossmenu']:openBossMenu(name, type)
```

<details>

<summary>Backward event from esx_society</summary>

We have a backward events for esx\_society, this means that if you have an `esx_society:openBossMenu` event used somewhere, you won't necessarily need to modify it.

**Note that in using this you still need to register the job/gang in config.lua `Config.JobMenusSettings`**

</details>

<details>

<summary>Backward event from qb-management</summary>

We have a backward events for qb-management, this means that if you have an `qb-bossmenu:client:OpenMenu`, `qb-gangmenu:client:OpenMenu` event used somewhere, you won't necessarily need to modify it.

**Note that in using this you still need to register the job/gang in config.lua `Config.JobMenusSettings`**

</details>

***

### openDressingRoom

Opening the company / gang dressing room

```lua
---@param {name: string}: Job / gang name e.g. 'police', 'mechanic', 'ballas'
---@param {type: string}: 'job' or 'gang'
exports['vms_bossmenu']:openDressingRoom(name, type)
```

<details>

<summary>Backward event from qb-management</summary>

We have a backward events for qb-management, this means that if you have an `qb-bossmenu:client:Wardrobe` event used somewhere, you won't necessarily need to modify it.

**Note that in using this you still need to register the job/gang in config.lua `Config.JobMenusSettings`**

</details>

***

### getGradePermissions

Get permissions information for grade specific jobs or gangs

```lua
---@param {jobName: string}: Registered job or gang name, e.g. 'police' / 'ballas'
---@param {grade: number}: Grade ID
---@param {getValues: boolean}: 
---@return boolean, table | string
local access, perms = exports['vms_bossmenu']:getGradePermissions(jobName, grade, getValues)
```

<details>

<summary>Explanation</summary>

#### Results:

Getting informations about grade permissions for which no permissions are configured:

```lua
local jobName = 'police'
local grade = 0 -- (Lowest grade - Recruit)
local getValues = false

local access, perms = exports['vms_bossmenu']:getGradePermissions(jobName, grade, getValues)

print(access)
-- print result: true or false

prints(perms)
-- perms will be true or nil, because you set getValues = false
```

Getting informations about grade perms for which it has permissions configured

```lua
local jobName = 'police'
local grade = 1
local getValues = true

local access, perms = exports['vms_bossmenu']:getGradePermissions(jobName, grade, getValues)

print(access)
-- print result: true or false

print(json.decode(perms))
-- example print result: {"employeesAccess":true,"safeDeposit":true,"clothingAccess":true,"safeAccess":true}
```

Getting informations about grade perms, which is entered in the`Config.JobMenusSettings` - `maxPermissionsGrades`

```lua
local jobName = 'police'
local grade = 4 -- entered in maxPermissionsGrades
local getValues = true

local access, perms = exports['vms_bossmenu']:getGradePermissions(jobName, grade, getValues)

print(access)
-- print result: true or false

print(perms)
-- print result: "max"
-- returns the value "max" if the grade is in maxPermissionsGrades.
```

</details>

***

### havePermission

Check if a certain grade of job/gang has permissions for a certain action

```lua
---@param {jobName: string}: Registered job or gang name, e.g. 'police' / 'ballas'
---@param {grade: number}: Grade ID
---@param {action: string}: permission name (List of permissions in #Explanation)
---@return boolean
local access = exports['vms_bossmenu']:havePermission(jobName, grade, action)
```

<details>

<summary>Explanation</summary>

#### Example:

```lua
local jobName = 'police'
local grade = 3
local action = 'safeTransfer'

local access = exports['vms_bossmenu']:havePermission(jobName, grade, action)

print(access)
-- print result: true or false
```

#### Permissions List:

* employeesAccess

  employeesGrantBonus\
  employeesChangeGrade

  employeesFire

  employeesHire
* clothingAccess

  clothingCreate

  clothingModify
* safeAccess

  safeBalance

  safeWithdraw

  safeDeposit

  safeTransfer

  safeTransactions
* stashAccess
* announcementsAccess
* resumesAccess
* taxesAccess

</details>
