Commit Graph
3 Commits
Author SHA1 Message Date
Isaac ConnorandClaude Opus 5.5 5784978733 test: check the API tab without the per-user API toggle refs #4908
The API can no longer be disabled per user, so the Options API tab has only
the token revoke checkbox and updateSelected only revokes the tokens of the
users marked. Post tokenUids instead of apiUids, expect one disabled
checkbox for System=View, and check that nothing writes APIEnabled. The
System=View checks that no write runs are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 11:58:25 -05:00
Nic Boet 4571649d8e fix(web): disable the API tab's per-user checkboxes without System edit
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)
2026-10-31 20:02:16 -04:00
Nic Boet 56996ad3f1 fix: require System edit to change API access or revoke tokens
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)
2026-10-31 20:02:16 -04:00