Disabling the API per user made pages that rely on it (Montage Review and
others) fail silently: the AJAX event queries came back 401
"API disabled for: <user>" and the page just drew empty boxes with no
indication of why.
Rather than keep a foot-gun that makes the UI look broken, drop the per-user
API-disable control entirely:
- AppController no longer rejects an authenticated user because APIEnabled != 1;
the API is available to any authenticated user.
- Remove the APIEnabled selector from the user edit view and the APIEnabled
column from the users list and the API options tab. The API options tab keeps
its token management (New Token, Revoke Token, Revoke All Tokens).
- The user token section no longer hides itself based on APIEnabled.
The Users.APIEnabled column and the model default are left in place so no
database migration is needed; the value is simply no longer consulted.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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)