> For the complete documentation index, see [llms.txt](https://viceworks.gitbook.io/vice-works-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://viceworks.gitbook.io/vice-works-docs/resources/business-hours/client-cl_access.lua.md).

# client/cl\_access.lua

If you are using the default qb-core or esx and have not renamed it, you should be good to go. But if you have changed it or are using a different framework, you should look between lines 21-61.

### function hasAccess(pBusinessId)

By default you can authorize the door business with job and cid (only for closing and opening the shop).

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

### function displayLockUi(pBusinessId, pDisplay, pIsOpen)

A function that by default does not run in a loop, but is triggered when you approach the door, move away and when the lock state changes, you can easily put your own ui export into it.

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

### function lockUiKeyPressed(pBusinessId, pLastOpenState)

It is a self-explanatory function, so you can change it if you don't like the animation.

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

### Thread

The thread between lines 139-159 should work if you are going to use the default lockui, but if you are going to put your own export, it is better to put it in the comment line.

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


---

# 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:

```
GET https://viceworks.gitbook.io/vice-works-docs/resources/business-hours/client-cl_access.lua.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.
