OPX//77
opx_infinityConcepts

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 permissionsACL rights
What they gateWhich platform natives a resource may callWhat a player may do
Where they livepermissions { ... } in the resource's open77.luathe server's acl.jsonc (named by accessControl.file)
Who sets themthe resource authorthe server operator
Exampledatabase.access, world.vehiclescommand.opx.admin, command.opx.garages.*

Manifest permissions

  • opx_infinity declares every permission its natives need in open77.lua. A native called without its permission answers permission_denied:<name>; the resource still starts.
  • opx_lib declares 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.lua in 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 rowcommand.opx.admin and command.opx.admin.*
use the garage, dealer and wardrobe staff commandscommand.opx.garages.*, command.opx.dealership.*, command.opx.clothing.*
control weather and timecommand.opx.weather.*, command.opx.time, command.opx.time.*
set money, jobs and gangs by commandcommand.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 admin and owner roles hold command.* 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.

On this page