Gate the Staff & ranks page behind @zio/webpanel

Staff without @zio/webpanel (or @css/root) no longer see the page: the API refuses it and the
panel leaves it out of the sidebar. The flag is offered in the rank editor.
This commit is contained in:
Astra 2026-09-29 19:08:25 +01:00
parent dc7a1e42bd
commit b2b4698776
3 changed files with 11 additions and 3 deletions

View file

@ -285,6 +285,7 @@ var knownFlags = [][3]string{
{"@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/webpanel is the panel's own: it shows the Staff & ranks page (adminStaff).
{"@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"},
@ -297,10 +298,15 @@ var knownFlags = [][3]string{
{"@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"},
{"@zio/webpanel", "Staff page", "See the Staff & ranks page in this panel"},
{"@css/root", "Root", "Every permission, and managing ranks and staff"},
}
func (s *Server) adminStaff(w http.ResponseWriter, r *http.Request, id *Identity, x *staffIndex) {
if !id.Has("@zio/webpanel") {
fail(w, http.StatusForbidden, "You need @zio/webpanel to see the staff page.")
return
}
st := s.poll.Current()
groups := s.groupViews(x, st, true)