Offer the @zio/... flags in the rank editor

The rank editor only listed @css/... flags, so a @zio/ flag showed up only on a rank that
already held it and couldn't be added to others. List the flags admin_overrides.json uses, plus
@zio/penalties from our SimpleAdmin fork.
This commit is contained in:
Astra 2026-09-29 17:58:27 +01:00
parent 0af93d1eab
commit dc7a1e42bd
2 changed files with 17 additions and 1 deletions

View file

@ -25,7 +25,9 @@ RCON. Without it the panel still works, but shows the server as offline and can'
SimpleAdmin writes them. They apply when the player next joins (bans are also picked up by SimpleAdmin writes them. They apply when the player next joins (bans are also picked up by
SimpleAdmin within about a minute). Kicks and warnings need the server. SimpleAdmin within about a minute). Kicks and warnings need the server.
- **Ranks and staff**: written to the database, then `css_reloadadmins`. A rank is a SimpleAdmin - **Ranks and staff**: written to the database, then `css_reloadadmins`. A rank is a SimpleAdmin
group (`#rank/mod`); staff are admins holding exactly one such group. group (`#rank/mod`); staff are admins holding exactly one such group. The rank editor offers the
`@css/...` flags and our `@zio/...` ones (from the server's `admin_overrides.json` and our
SimpleAdmin fork); a new `@zio/` flag needs adding to `knownFlags` in `internal/web/admin.go`.
- **Permissions**: commands sent over RCON run as Console, which skips all of SimpleAdmin's own - **Permissions**: commands sent over RCON run as Console, which skips all of SimpleAdmin's own
checks, so the panel enforces them itself with the same flags: checks, so the panel enforces them itself with the same flags:

View file

@ -283,6 +283,20 @@ var knownFlags = [][3]string{
{"@css/cheats", "Cheats", "sv_cheats-protected commands"}, {"@css/cheats", "Cheats", "sv_cheats-protected commands"},
{"@css/bypassipban", "Bypass IP bans", "Joins even when their IP, or another account on it, is banned"}, {"@css/bypassipban", "Bypass IP bans", "Joins even when their IP, or another account on it, is banned"},
{"@css/vip", "VIP", "VIP perks in other plugins"}, {"@css/vip", "VIP", "VIP perks in other plugins"},
// Our own flags: admin_overrides.json (in the server repo) moves these commands onto them, and
// our SimpleAdmin fork checks @zio/penalties itself. Each command also accepts @css/root.
{"@zio/menu", "Admin menu", "css_admin and css_adminhelp"},
{"@zio/who", "Who", "css_who and css_players"},
{"@zio/penalties", "Others' penalties", "css_penalties on another player"},
{"@zio/psay", "Private message", "css_psay"},
{"@zio/csay", "Centre messages", "css_csay, css_hsay and css_cssay"},
{"@zio/listenall", "Listen to all", "css_listenall and css_adminvoice"},
{"@zio/team", "Move teams", "css_team"},
{"@zio/rename", "Rename", "css_rename"},
{"@zio/banip", "IP bans", "css_banip"},
{"@zio/restart", "Restart game", "css_rr, css_rg, css_restart and css_restartgame"},
{"@zio/vote", "Start votes", "css_vote"},
{"@zio/plugins", "Plugins", "css_plugins and css"},
{"@css/root", "Root", "Every permission, and managing ranks and staff"}, {"@css/root", "Root", "Every permission, and managing ranks and staff"},
} }