audiobookshelf/test/server
zriddle 464b720d9e Add canStream user permission to control streaming access
Adds a per-user "Can Stream" permission mirroring the existing "Can Download"
pattern. Server admins can now disable streaming for specific users, encouraging
local downloads instead. Addresses #2572.

Changes:
- User model: stream permission in mapping, defaults, and getter
- ApiKey model: stream permission in defaults
- Controller: 403 enforcement on playback session creation endpoints
- Frontend: permission toggle in admin UI, play button gated by canStream,
  download button shown when streaming disabled, message when neither allowed
- Tests: 11 Mocha tests (model + controller), 1 Cypress test (card UI)
- Localization: English strings for toggle label and fallback message

The getter uses !== false (rather than !!) so existing users without the
stream key in their permissions JSON default to allowed on upgrade.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 14:12:08 -06:00
..
controllers Add canStream user permission to control streaming access 2026-04-02 14:12:08 -06:00
finders Improved subtitle parsing to account for bare colon in title 2026-02-06 14:31:09 -05:00
managers Merge pull request #3417 from nichwall/series_cleanup_2 2024-10-12 15:48:04 -05:00
migrations Improve book library page query performance for author sort order (#4080) 2025-03-17 17:09:49 -05:00
models Add canStream user permission to control streaming access 2026-04-02 14:12:08 -06:00
objects Fixes + add progress to m4b and embed tools 2024-07-20 12:28:06 +03:00
providers Add tests for cleanSeriesSequence 2024-03-14 19:37:51 +02:00
utils Improved subtitle parsing to account for bare colon in title 2026-02-06 14:31:09 -05:00
Logger.test.js Log non-strings into log file like console.log does 2024-09-11 19:58:30 +03:00