Permissions
Last updated on
Open77 has two permission systems — manifest permissions that let a resource call natives, and ACL rights that let a player run a command — and opx_infinity uses both.
Two separate systems; do not confuse them.
| Manifest permissions | ACL rights | |
|---|---|---|
| What they gate | Which platform natives a resource may call | What a player may do |
| Where they live | permissions { ... } in the resource's open77.lua | the server's acl.jsonc (named by accessControl.file) |
| Who sets them | the resource author | the server operator |
| Example | database.access, world.vehicles | command.opx.admin, command.opx.garages.* |
Manifest permissions
opx_infinitydeclares every permission its natives need inopen77.lua. A native called without its permission answerspermission_denied:<name>; the resource still starts.opx_libdeclares none: a library runs in the consumer's VM, so the consumer's manifest is checked (opx_lib).- When you add a native call, look it up with the Open77 devkit and add its permission to
open77.luain the same change.
ACL rights
Commands
A command registered restricted (OPX.Command.Register(name, { restricted = true }, ...)) is checked by the host against command.<name> before the handler runs. A player without it gets no answer from the resource.
The right matches the typed word exactly; only a rule ending in .* is a prefix. So a role needs both spellings to open a menu and use what is in it:
| To let a role… | Grant |
|---|---|
| open the staff menu and use every row | command.opx.admin and command.opx.admin.* |
| use the garage, dealer and wardrobe staff commands | command.opx.garages.*, command.opx.dealership.*, command.opx.clothing.* |
| control weather and time | command.opx.weather.*, command.opx.time, command.opx.time.* |
| set money, jobs and gangs by command | command.opx.money, command.opx.job, command.opx.gang (character) |
- Short aliases (
noclip,goto, … —COMMAND_ALIASES) are checked against the long command's right, so an alias is never less restricted than its command. - Each module page lists its commands with the right each needs. The built-in
adminandownerroles holdcommand.*and*and need nothing more.
Rights that are not commands
opx_infinity checks no right outside command.*. The old opx.dealership.place right is no longer read by any code (showroom cars are written in config/dealership.lua); remove it from roles.
Checking a right in code
A staff action that does not arrive as a restricted command (e.g. a net event from a menu) must check the right on the server with Open77.acl.isAllowed(source, '<right>') (needs the acl.read permission). Hiding a button is not a check.
Text and locales
Player-facing text comes from English and French catalogues looked up by key with OPX.Locale or the locale() shorthand; the server language is set once in config/shared.lua.
Core
The opx_infinity API that no single module owns — the OPX.* runtime, its configuration, runtime events, the lib/ helpers and the shared error codes.