summaryrefslogtreecommitdiffstats
path: root/apps/files/js/files.js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-09-04 19:58:49 +0200
committerVincent Petry <pvince81@owncloud.com>2014-09-04 20:18:24 +0200
commitf1bfe35cda2f11d1b38726cf2d4f879427b2c8d5 (patch)
tree227884fd46ddbeea15702b1aba14b56644ff05ce /apps/files/js/files.js
parent1a7df3323391f6d6f7ef04de2687b3a566ab6351 (diff)
downloadnextcloud-server-f1bfe35cda2f11d1b38726cf2d4f879427b2c8d5.tar.gz
nextcloud-server-f1bfe35cda2f11d1b38726cf2d4f879427b2c8d5.zip
Added permission check for drag and drop
When dropping files onto a read-only folder, a notification is now shown instead of attempting to upload. This for both the drag for upload and drag from inside the file list cases.
Diffstat (limited to 'apps/files/js/files.js')
-rw-r--r--apps/files/js/files.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index df0c40a4405..5fcf99d24af 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -433,7 +433,12 @@ var folderDropOptions = {
return false;
}
- var targetPath = FileList.getCurrentDirectory() + '/' + $(this).closest('tr').data('file');
+ var $tr = $(this).closest('tr');
+ if (($tr.data('permissions') & OC.PERMISSION_CREATE) === 0) {
+ FileList._showPermissionDeniedNotification();
+ return false;
+ }
+ var targetPath = FileList.getCurrentDirectory() + '/' + $tr.data('file');
var files = FileList.getSelectedFiles();
if (files.length === 0) {