Integration

Admin

Admin roles through ACE permissions, what each role can do and see, and the admin commands.

The admin tablet has three roles: god, admin and moderator. A player gets one through an ACE permission or through the framework.

luaConfig.Admin = {
    Command = 'phoneadmin',
    Ace = { god = 'fxphone.god', admin = 'fxphone.admin', moderator = 'fxphone.mod' },
    FrameworkAdminsAre = 'admin',   -- 'god' | 'admin' | 'moderator' | false
}

All settings: Other settings. What the tablet looks like: Admin tablet.

#Granting roles in server.cfg

By group:

cfgadd_ace group.owner fxphone.god allow
add_ace group.owner fxphone.admin allow
add_ace group.admin fxphone.admin allow
add_ace group.mod fxphone.mod allow

For one player, add them to a group with their own identifier:

cfgadd_principal identifier.license:<license> group.admin
add_principal identifier.discord:<discord id> group.mod

The fxphone.admin line for owners is only needed for the console commands fxphone:number, fxphone:wipe and fxphone:mail when they are run in game. Those check fxphone.admin or the framework admin check, not the tablet role.

#How the role is chosen

  1. The first ACE the player has, checked in the order god, admin, moderator.
  2. If the framework considers the player an admin and FrameworkAdminsAre is higher than that, the player gets FrameworkAdminsAre. false turns this off, so only ACEs count.
  3. The server console is always god.

The role is cached for 5 seconds, so a changed ACE applies almost at once.

Framework Counts as framework admin
QBCore admin or god permission
Qbox group.admin ACE
ESX Group admin or superadmin
standalone group.admin ACE
custom Whatever IsAdmin returns in bridge/custom.lua

#What each role can do

Capability moderator admin god
Open the tablet, dashboard, all lists, audit log yes yes yes
Delete and restore posts, comments, stories, listings, news yes yes yes
Close Darkchat channels, kick members, resolve reports yes yes yes
Verify and unverify social accounts no yes yes
Ban, unban, rename, reset password, delete and restore social accounts no yes yes
Users: search, view, set number, reset PIN, factory reset no yes yes
See the backup list no yes yes
Wipe a user no no yes
Apps on/off, runtime settings, retention, logging switches no no yes
Create a snapshot now (tablet or fxphone:backup) no no yes

Every request from the tablet is checked again on the server.

#What each role is shown

Tablet replies are filtered on the server before they leave it:

Data moderator admin god
IP addresses no no no
Character identifiers reference only reference only yes
Phone numbers, IBANs, character names no yes yes

A reference lets the tablet act on the character without revealing the identifier. It only means something on this server until the next restart. Lists load 50 rows at a time, 200 at most.

#Commands

Command Who What it does
/phoneadmin Players with a role Opens the tablet. The name is Config.Admin.Command
fxphone:admin <id> Console Opens the tablet for that player with their role, or prints that they have none
fxphone:backup Console, god role Starts a snapshot now
fxphone:number <identifier> <number> Console, fxphone.admin, framework admins Gives a character a new number
fxphone:wipe <identifier> Same Deletes every phone row of a character
fxphone:mail <id or identifier or -1> <sender> <subject> <message> Same Sends a mail. -1 is everyone
/phonecam Role in Config.Camera.TuneRole (god by default) Opens the lens tuning panel

#Other permissions

ACE Used for
fxphone.hacker The Anon terminal (Config.Anon.Hacker.Ace). See Anon

#Audit

Every tablet action is written to the audit log (tablet, Audit) with who, what, and the values before and after, and fires an admin.* log event. Attempts without a role are logged as admin.unauthorized, at most once per player every 30 seconds.

The audit log is kept for Config.Admin.AuditDays days. Log events: Logging.