Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.2.0] Backport of Remove share permission check from the file up… #35082

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions apps/files/js/file-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -829,11 +829,7 @@ OC.Uploader.prototype = _.extend({
return true;
}
var fileInfo = fileList.findFile(file.name);
var sharePermission = $("#sharePermission").val();
if (sharePermission !== undefined) {
sharePermission &= (OC.PERMISSION_READ | OC.PERMISSION_UPDATE | OC.PERMISSION_CREATE | OC.PERMISSION_DELETE);
}
if (fileInfo && (sharePermission !== (OC.PERMISSION_READ | OC.PERMISSION_UPDATE | OC.PERMISSION_CREATE))) {
if (fileInfo) {
conflicts.push([
// original
_.extend(fileInfo, {
Expand Down
17 changes: 17 additions & 0 deletions tests/acceptance/features/bootstrap/WebUIFilesContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,23 @@ public function theUserChoosesToInTheUploadDialog($label) {
$pageObject->waitForUploadProgressbarToFinish();
}

/**
* @When the user uploads file :name and clicks :label button :number_of times using webUI
*
* @param string $name
* @param string $label
* @param int $number_of
*
* @return void
*/
public function theUserClicksUploadAndCancelMultipleTimes($name, $label, $number_of) {
for ($i = 0; $i < $number_of; $i++) {
$this->theUserUploadsFileUsingTheWebUI($name);
$this->theUserChoosesToInTheUploadDialog($label);
\usleep(STANDARD_SLEEP_TIME_MICROSEC);
}
}

/**
* @Then /^the (?:deleted|moved) elements should (not|)\s?be listed on the webUI$/
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ Feature: Share by public link
When the user creates a new public link for folder "simple-folder" using the webUI with
| permission | upload-write-without-modify |
And the public accesses the last created public link using the webUI
Then it should not be possible to delete file "lorem.txt" using the webUI

Scenario: user edits the permission of an already existing public link from read-write to upload-write-without-overwrite
Given the user has created a new public link for folder "simple-folder" using the webUI with
Expand All @@ -380,3 +381,14 @@ Feature: Share by public link
When the user uploads file "lorem.txt" keeping both new and existing files using the webUI
Then file "lorem.txt" should be listed on the webUI
And file "lorem (2).txt" should be listed on the webUI

Scenario: user creates public link with view download and upload feature and uploads and cancels same file multiple times to verify the conflict dialog exits after clicking cancel button
Given the user has created a new public link for folder "simple-folder" using the webUI with
| permission | upload-write-without-modify |
And the public accesses the last created public link using the webUI
When the user uploads file "lorem.txt" and clicks "Cancel" button 10 times using webUI
Then no dialog should be displayed on the webUI
And no notification should be displayed on the webUI
And file "lorem.txt" should be listed on the webUI
And the content of "lorem.txt" should not have changed
And file "lorem (2).txt" should not be listed on the webUI