audiobookshelf/client/components/cards
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
..
AuthorCard.vue Implement new JWT auth 2025-06-29 17:22:58 -05:00
AuthorSearchCard.vue Tailwind V4 migration initial commit 2025-03-16 16:41:37 +02:00
BookMatchCard.vue Add match confidence as a badge on match book card 2025-07-21 16:52:21 -05:00
EpisodeSearchCard.vue Add support for searching podcast episode titles #3301 2025-05-15 17:16:15 -05:00
GenreSearchCard.vue Tailwind V4 migration initial commit 2025-03-16 16:41:37 +02:00
GroupCard.vue Tailwind V4 migration initial commit 2025-03-16 16:41:37 +02:00
ItemSearchCard.vue Tailwind V4 migration initial commit 2025-03-16 16:41:37 +02:00
ItemTaskRunningCard.vue Tailwind V4 migration initial commit 2025-03-16 16:41:37 +02:00
ItemUploadCard.vue Remove duplicate (and also wrong byte conversion) 2025-10-09 08:49:13 +02:00
LazyBookCard.vue Add canStream user permission to control streaming access 2026-04-02 14:12:08 -06:00
LazyCollectionCard.vue Fix double slash in color modifier 2025-03-23 08:34:11 +02:00
LazyPlaylistCard.vue Fix double slash color modifer typo 2025-03-23 08:57:13 +02:00
LazySeriesCard.vue Use getServerSetting to ensure serverSettings is set before accessing 2025-07-06 17:39:03 -05:00
NarratorCard.vue Tailwind V4 migration initial commit 2025-03-16 16:41:37 +02:00
NarratorSearchCard.vue Tailwind V4 migration initial commit 2025-03-16 16:41:37 +02:00
NotificationCard.vue Tailwind V4 migration initial commit 2025-03-16 16:41:37 +02:00
PodcastFeedSummaryCard.vue Tailwind V4 migration initial commit 2025-03-16 16:41:37 +02:00
SeriesSearchCard.vue Tailwind V4 migration initial commit 2025-03-16 16:41:37 +02:00
TagSearchCard.vue Tailwind V4 migration initial commit 2025-03-16 16:41:37 +02:00