# Bypass Staff

The function is customizable, allowing you to integrate your permission system. By default, it supports ESX, txAdmin, and ace Permissions.

**Exemple Usage Ace Permission :**\
`add_ace wolfshield allow`\
`add_ace identifier.license:000000000000000 wolfshield allow`

\
`add_ace group.mod wolfshield  allow`

{% code title="configs/open-source-function/main.lua" %}

```lua
local bypassPlayer, ESX = {}, nil

Citizen.CreateThread(function()
    xpcall(function()
        ESX = exports['es_extended']:getSharedObject()
    end, function(err)
        ESX = nil
    end)
end)

AddEventHandler("txAdmin:events:adminAuth", function(data)
    if (data.isAdmin) then
        if( bypassPlayer[data.netid]) then return end
        bypassPlayer[data.netid] = true
    end
end)

BanBypass = function(source)
	local playerId = source
	if (ESX ~= nil) then
		xPlayer = ESX.GetPlayerFromId(playerId)
		if (not xPlayer) then return false end
		if (xPlayer.getGroup() == "user" and not bypassPlayer[playerId] and not IsPlayerAceAllowed(playerId, "wolfshield")) then
			return false -- The player will be banned
		else
			return true -- The player will not be banned
		end
	else
		if (bypassPlayer[playerId] or IsPlayerAceAllowed(playerId, "wolfshield")) then
			return true -- The player will not be banned
		else
			return false -- The player will be banned
		end
	end
end
```

{% endcode %}


---

# 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://wolf-shield.gitbook.io/doc-wolf-shield/documentation/for-developper/bypass-staff.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.
