The Update and Revoke All Tokens buttons are disabled for users without
System edit since the handlers refuse them; the Revoke Token and API
Enabled checkboxes next to each user stayed clickable and did nothing.
Disable them the same way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit f096e919c2)
The API tab of Options renders for any user with System view, and the
view itself handled its two POST buttons: updateSelected sets
Users.APIEnabled for every user and revokeAllTokens bumps every user's
TokenMinExpiry. includes/actions/options.php refuses a System=View user,
but returns before the view is rendered, so the view went on and ran
the UPDATEs. A System=View user could turn off API access for every
account, admins included, and invalidate every issued token.
Run both handlers only when canEdit('System'), log a warning otherwise,
and disable the two buttons for users who cannot use them.
tests/php/test_options_api_requires_system_edit.php includes the view
with System=View and System=Edit and checks which SQL it sends.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 6e64739e84)