Files
overextended.github.io/pages/ox_lib/Modules/ACL/Server.mdx
T
Jag 74227cc262 chore: oxmysql and ox_lib clean-up (#134)
* oxmysql and some lib interface fixes

- Various fixes throughout oxmysql
- started ox_lib audit

* chore: More clean up

- Reword some confusing descriptions
- Add some descriptions
- Type fixes
- Spelling and grammar fixes
- Swapping in `-` where `*` used to be for 
bullet point consistency

ox_lib
- Interface, ACL through GetClosestVehicle audited

* chore: Finishing up ox_lib
2023-07-03 13:13:56 +10:00

127 lines
2.1 KiB
Plaintext

Wrapper around the built-in ACL system. Handles lib.addCommand and ox_groups permissions.
Refer to [Basic Aces & Principals overview/guide](https://forum.cfx.re/t/basic-aces-principals-overview-guide/90917) for more information.
import { Tabs, Tab } from 'nextra-theme-docs';
### lib.addAce
Assigns the ace permission to a principal. Third parameter defaults to 'allow', while passing `false` sets the permission to 'deny'.
<Tabs items={["Lua", "JS"]}>
<Tab>
```lua
lib.addAce(principal, ace, allow)
lib.addAce('group.admin', 'command.say')
```
</Tab>
<Tab>
```ts
import lib from '@overextended/ox_lib/server'
lib.addAce(principal, ace, allow)
lib.addAce('group.admin', 'command.say')
```
</Tab>
</Tabs>
* principal: `string`
* ace: `string`
* allow: `boolean`
### lib.removeAce
Removes the ace permission from a principal. Third parameter defaults to 'allow', while passing `false` sets the permission to 'deny'.
<Tabs items={["Lua", "JS"]}>
<Tab>
```lua
lib.removeAce(principal, ace, allow)
lib.removeAce('group.admin', 'command.say')
```
</Tab>
<Tab>
```ts
import lib from '@overextended/ox_lib/server'
lib.removeAce(principal, ace, allow)
lib.removeAce('group.admin', 'command.say')
```
</Tab>
</Tabs>
* principal: `string`
* ace: `string`
* allow: `boolean`
### lib.addPrincipal
Assigns a principal to a parent principal. Children inherit permissions from the parent.
<Tabs items={["Lua", "JS"]}>
<Tab>
```lua
lib.addPrincipal(child, parent)
lib.addPrincipal('player.1', 'group.moderator')
```
</Tab>
<Tab>
```ts
import lib from '@overextended/ox_lib/server'
lib.addPrincipal(child, parent)
lib.addPrincipal('player.1', 'group.moderator')
```
</Tab>
</Tabs>
* child: `string`
* parent: `string`
### lib.removePrincipal
Removes a principal from a parent principal.
<Tabs items={["Lua", "JS"]}>
<Tab>
```lua
lib.removePrincipal(child, parent)
lib.removePrincipal('player.1', 'group.moderator')
```
</Tab>
<Tab>
```ts
import lib from '@overextended/ox_lib/server'
lib.removePrincipal(child, parent)
lib.removePrincipal('player.1', 'group.moderator')
```
</Tab>
</Tabs>
* child: `string`
* parent: `string`