summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-05-27 09:02:52 +0200
committerVincent Petry <pvince81@owncloud.com>2014-05-27 09:02:52 +0200
commita79f3fd1c0ddf9b8ac4d59ce2affccd4aabf83a0 (patch)
tree4ceaa19e28a7cfdc4447a3d5c19c071547bb0a0c /apps
parenta756666585be41752e376cb42fd445b8155b1d74 (diff)
parent36f63ea990eb8c1b93243361fafae35b8c5b7820 (diff)
downloadnextcloud-server-a79f3fd1c0ddf9b8ac4d59ce2affccd4aabf83a0.tar.gz
nextcloud-server-a79f3fd1c0ddf9b8ac4d59ce2affccd4aabf83a0.zip
Merge pull request #8728 from owncloud/sharing_fix_reshare
allow resharing of files with only share permissions
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/filelist.js14
-rw-r--r--apps/files_sharing/js/share.js11
2 files changed, 14 insertions, 11 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 3dcd9dd3eaa..72e1a688041 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -522,12 +522,6 @@
mime = mime || 'httpd/unix-directory';
}
- // user should always be able to rename a share mount point
- var allowRename = 0;
- if (fileData.isShareMountPoint) {
- allowRename = OC.PERMISSION_UPDATE;
- }
-
//containing tr
var tr = $('<tr></tr>').attr({
"data-id" : fileData.id,
@@ -537,7 +531,7 @@
"data-mime": mime,
"data-mtime": mtime,
"data-etag": fileData.etag,
- "data-permissions": fileData.permissions | allowRename || this.getDirectoryPermissions()
+ "data-permissions": fileData.permissions || this.getDirectoryPermissions()
});
if (type === 'dir') {
@@ -936,7 +930,7 @@
/**
* Lazy load a file's preview.
- *
+ *
* @param path path of the file
* @param mime mime type
* @param callback callback function to call when the image was loaded
@@ -1639,7 +1633,7 @@
if (fileDirectory.length === 1) {
fileDirectory = fileDirectory[0];
- // Get the directory
+ // Get the directory
var fd = self.findFileEl(fileDirectory);
if (fd.length === 0) {
var dir = {
@@ -1655,7 +1649,7 @@
} else {
fileDirectory = fileDirectory[0];
}
-
+
fileDirectory = self.findFileEl(fileDirectory);
// update folder size
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index 893577db2e3..84c5bf57b38 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -21,6 +21,11 @@ $(document).ready(function() {
var tr = oldCreateRow.apply(this, arguments);
if (fileData.shareOwner) {
tr.attr('data-share-owner', fileData.shareOwner);
+ // user should always be able to rename a mount point
+ if (fileData.isShareMountPoint) {
+ tr.attr('data-permissions', fileData.permissions | OC.PERMISSION_UPDATE);
+ tr.attr('data-reshare-permissions', fileData.permissions);
+ }
}
return tr;
};
@@ -78,7 +83,11 @@ $(document).ready(function() {
if ($(tr).data('type') == 'dir') {
itemType = 'folder';
}
- var possiblePermissions = $(tr).data('permissions');
+ var possiblePermissions = $(tr).data('reshare-permissions');
+ if (_.isUndefined(possiblePermissions)) {
+ possiblePermissions = $(tr).data('permissions');
+ }
+
var appendTo = $(tr).find('td.filename');
// Check if drop down is already visible for a different file
if (OC.Share.droppedDown) {