Skip to content

Commit

Permalink
fix: solve publicly shared document with hide download issue
Browse files Browse the repository at this point in the history
Signed-off-by: Luka Trovic <luka@nextcloud.com>
  • Loading branch information
luka-nextcloud committed Feb 21, 2023
1 parent faa8b69 commit 8362640
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
13 changes: 0 additions & 13 deletions cypress/e2e/share.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,4 @@ describe('Open test.md in viewer', function() {
cy.get('.modal-mask').should('not.exist')
})
})

it('Share a file with download disabled shows an error', function() {
cy.shareFileToUser('test.md', recipient, {
attributes: '[{"scope":"permissions","key":"download","enabled":false}]',
}).then(() => {
cy.login(recipient)
cy.visit('/apps/files')
cy.openFile('test.md')
cy.getModal().find('.empty-content__title').should('contain', 'Failed to load file')
cy.getModal().getContent().should('not.exist')
})
})

})
2 changes: 1 addition & 1 deletion cypress/e2e/workspace.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('Workspace', function() {
cy.get('.files-fileList').should('contain', 'README.md')
cy.get('#rich-workspace .ProseMirror')
.should('contain', 'Hello world')
cy.get('a[href*="/apps/files/recent"]')
cy.get('li[data-id="recent"] a.nav-icon-recent')

This comment has been minimized.

Copy link
@juliusknorr

juliusknorr Feb 21, 2023

Member

The change seems unrelated and to cause the failure on CI

.click()
cy.get('#rich-workspace .ProseMirror')
.should('not.visible')
Expand Down
4 changes: 0 additions & 4 deletions lib/Service/DocumentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,6 @@ public function checkSharePermissions($shareToken, $permission = Constants::PERM
if (($share->getPermissions() & $permission) === 0) {
throw new NotFoundException();
}

if ($share->getHideDownload()) {
throw new NotPermittedException();
}
}

public function hasUnsavedChanges(Document $document) {
Expand Down

0 comments on commit 8362640

Please sign in to comment.