diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2014-04-17 15:54:45 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2014-04-23 12:54:26 +0200 |
commit | 7ef8f6d352811e635bc6cf99b56d9482a54eb791 (patch) | |
tree | 64f51aa93d4dae96accb2f0a979571b09305edfa /apps | |
parent | b102222fed33245c6da8a39c28f0d0a570d0dbea (diff) | |
download | nextcloud-server-7ef8f6d352811e635bc6cf99b56d9482a54eb791.tar.gz nextcloud-server-7ef8f6d352811e635bc6cf99b56d9482a54eb791.zip |
always allow to rename the share mount point
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/js/filelist.js | 13 | ||||
-rw-r--r-- | apps/files/lib/helper.php | 3 | ||||
-rw-r--r-- | apps/files_sharing/lib/cache.php | 4 |
3 files changed, 19 insertions, 1 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 343da217416..390bf4e0577 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -178,6 +178,13 @@ window.FileList = { if (type === 'dir') { 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, @@ -187,7 +194,7 @@ window.FileList = { "data-mime": mime, "data-mtime": mtime, "data-etag": fileData.etag, - "data-permissions": fileData.permissions || this.getDirectoryPermissions() + "data-permissions": fileData.permissions | allowRename || this.getDirectoryPermissions() }); if (type === 'dir') { @@ -283,6 +290,10 @@ window.FileList = { mime = fileData.mimetype, permissions = parseInt(fileData.permissions, 10) || 0; + if (fileData.isShareMountPoint) { + permissions = permissions | OC.PERMISSION_UPDATE; + } + if (type === 'dir') { mime = mime || 'httpd/unix-directory'; } diff --git a/apps/files/lib/helper.php b/apps/files/lib/helper.php index 88a5ffcfb61..0ae87d12fbf 100644 --- a/apps/files/lib/helper.php +++ b/apps/files/lib/helper.php @@ -96,6 +96,9 @@ class Helper if (isset($i['displayname_owner'])) { $entry['shareOwner'] = $i['displayname_owner']; } + if (isset($i['is_share_mount_point'])) { + $entry['isShareMountPoint'] = $i['is_share_mount_point']; + } return $entry; } diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php index 4a2f0ff08b2..67a0410ef76 100644 --- a/apps/files_sharing/lib/cache.php +++ b/apps/files_sharing/lib/cache.php @@ -91,6 +91,9 @@ class Shared_Cache extends Cache { $data = $cache->get($this->files[$file]); $data['displayname_owner'] = \OC_User::getDisplayName($this->storage->getSharedFrom()); $data['path'] = $path; + if ($file === '') { + $data['is_share_mount_point'] = true; + } return $data; } } else { @@ -123,6 +126,7 @@ class Shared_Cache extends Cache { } if (isset($mountPoint)) { $data['path'] = 'files/' . $mountPoint; + $data['is_share_mount_point'] = true; } return $data; } |