Skip to content

fix(permissions): only offer the personal tag menu to ADMFLAG_CUSTOM1 - #121

Merged
Rushaway merged 1 commit into
masterfrom
fix/tag-settings-custom1
Nov 18, 2026
Merged

Rushaway merged 1 commit into
masterfrom
fix/tag-settings-custom1

Conversation

@Rushaway

@Rushaway Rushaway commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Problem

The plugin uses different checks for the personal tag and colors:

Step Check
!tagmenu, !tag, !tagcolor... ADMFLAG_CUSTOM1
!settings > Tag Settings > Menu_Main() none
Saving a change to ccc_tag none
Loading the personal row on join (OnClientPostAdminCheck) ADMFLAG_CUSTOM1 (ADMFLAG_GENERIC only gets the group tag)

So an admin with b but not o (or any player with no flags) could open the tag menu from !settings, change their tag and colors, see them for the rest of the map (the chat display accepts b or o), and lose them on the next map. Each save also wrote the whole row back with the group tag values plus the one changed field.

The personal tag stays a ADMFLAG_CUSTOM1 feature (the flag of every personal tag command and the only one whose row is loaded), so the fix is to stop offering it to anyone else, not to load it for b.

Changes

  • Menu_Main() only lists the personal items (current, tag, name, chat, colors toggle) for ADMFLAG_CUSTOM1. The Administrative Options entry stays for slay/cheats admins, so sm_cccreset / sm_cccban from the menu keep working for them. With neither, it prints a new CCC_NoTagAccess message instead of opening.
  • MenuHandler_Main re-checks the flags on select (admins can be reloaded while the menu is open).
  • The Tag Settings entry of !settings is drawn disabled without either access (kept, so the item indexes of the handler stay the same).
  • New phrase CCC_NoTagAccess (en, fr, ru, es, de, pt, chi).
  • Version 8.1.9.

Checked

Tested in game on a CS:S test server (SM 1.13, 64-bit), CCC on SQLite, with the CI package-sm1.13 build. The admin flags were forced with a temporary helper plugin (SetUserAdmin in OnClientPostAdminFilter, removed afterwards).

  • Compiles with spcomp64 1.12.0.7260 and the CI include set: no error, no warning. CI green on SM 1.12 and 1.13.7427.
  • Before the fix (8.1.8), abcfjkp admin (no o): Tag Settings opened the full personal menu (current, tag, name, chat, toggle).
  • abcfjkp admin: Tag Settings opens the menu with Administrative Options only; the admin submenu (reset/ban/unban) opens and Back returns to it.
  • No flags: the Tag Settings key does nothing (CS:S draws disabled radio items like the others, but the key is inactive).
  • abcdefjkop admin (with o): full menu; sm_tag + sm_namecolor saved, still there after a map change (View Current Settings).

The personal tag and colors are only read back on join for ADMFLAG_CUSTOM1
(OnClientPostAdminCheck), but !settings > Tag Settings opened the full tag
menu with no flag check. Admins with only ADMFLAG_GENERIC (and players
with no flags) could change their tag and colors, see them for the rest of
the map, then lose them on the next map; each save also overwrote the
stored row with the group tag values.

- Menu_Main only lists the personal items (current, tag, name, chat,
  toggle) for ADMFLAG_CUSTOM1, and keeps the "Administrative Options" entry
  for slay/cheats admins; with neither it prints a no-access message.
- MenuHandler_Main re-checks the flags on select.
- The Tag Settings entry of !settings is disabled without either access.
- Bump to 8.1.9.
@Rushaway Rushaway added bug Something isn't working priority: medium Medium priority area: permissions Admin flags and access checks labels Nov 18, 2026
@Rushaway
Rushaway marked this pull request as ready for review November 18, 2026 11:58
@Rushaway
Rushaway merged commit 97fc430 into master Nov 18, 2026
11 checks passed
@Rushaway
Rushaway deleted the fix/tag-settings-custom1 branch November 18, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: permissions Admin flags and access checks bug Something isn't working priority: medium Medium priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant