diff --git a/client/components/cards/LazyBookCard.vue b/client/components/cards/LazyBookCard.vue index 51f657db..1d7be2d9 100644 --- a/client/components/cards/LazyBookCard.vue +++ b/client/components/cards/LazyBookCard.vue @@ -436,7 +436,7 @@ export default { return !this.isSelectionMode && !this.showPlayButton && this.ebookFormat }, showPlayButton() { - return !this.isSelectionMode && !this.isMissing && !this.isInvalid && !this.isStreaming && (this.numTracks || this.recentEpisode) + return this.userCanStream && !this.isSelectionMode && !this.isMissing && !this.isInvalid && !this.isStreaming && (this.numTracks || this.recentEpisode) }, showSmallEBookIcon() { return !this.isSelectionMode && this.ebookFormat @@ -476,6 +476,9 @@ export default { userCanDownload() { return this.store.getters['user/getUserCanDownload'] }, + userCanStream() { + return this.store.getters['user/getUserCanStream'] + }, userIsAdminOrUp() { return this.store.getters['user/getIsAdminOrUp'] }, diff --git a/client/components/modals/AccountModal.vue b/client/components/modals/AccountModal.vue index 6f4b7b67..8465298e 100644 --- a/client/components/modals/AccountModal.vue +++ b/client/components/modals/AccountModal.vue @@ -42,6 +42,15 @@ +
{{ $strings.LabelPermissionsStream }}
+{{ $strings.LabelPermissionsUpdate }}
@@ -354,6 +363,7 @@ export default { userTypeUpdated(type) { this.newUser.permissions = { download: type !== 'guest', + stream: true, update: type === 'admin', delete: type === 'admin', upload: type === 'admin', diff --git a/client/cypress/tests/components/cards/LazyBookCard.cy.js b/client/cypress/tests/components/cards/LazyBookCard.cy.js index ab685b0d..352691dc 100644 --- a/client/cypress/tests/components/cards/LazyBookCard.cy.js +++ b/client/cypress/tests/components/cards/LazyBookCard.cy.js @@ -42,6 +42,7 @@ function createMountOptions() { 'user/getUserCanUpdate': true, 'user/getUserCanDelete': true, 'user/getUserCanDownload': true, + 'user/getUserCanStream': true, 'user/getIsAdminOrUp': true, 'user/getUserMediaProgress': (id) => null, 'user/getUserSetting': (settingName) => false, @@ -163,6 +164,15 @@ describe('LazyBookCard', () => { cy.get('&ebookFormat').should('not.exist') }) + it('hides play button on mouseover when user cannot stream', () => { + mountOptions.mocks.$store.getters['user/getUserCanStream'] = false + cy.mount(LazyBookCard, mountOptions) + cy.get('#book-card-0').trigger('mouseover') + + cy.get('&overlay').should('be.visible') + cy.get('&playButton').should('be.hidden') + }) + it('routes to item page when clicked', () => { mountOptions.mocks.$router = { push: cy.stub().as('routerPush') } cy.mount(LazyBookCard, mountOptions) diff --git a/client/pages/item/_id/index.vue b/client/pages/item/_id/index.vue index 1d8f0f20..d2ce3bee 100644 --- a/client/pages/item/_id/index.vue +++ b/client/pages/item/_id/index.vue @@ -86,6 +86,15 @@ {{ isStreaming ? $strings.ButtonPlaying : $strings.ButtonPlay }} ++ {{ $strings.MessageNoStreamOrDownloadAccess }} +
+