aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-11-02 15:27:58 +0100
committerLukas Reschke <lukas@owncloud.com>2015-11-22 16:05:50 +0100
commit21da6271a8656517e956aa8897d8316b6a61ceac (patch)
treef97971fc33b2ad53025debc260d1eaa5701e2494 /apps/files_sharing/js
parentdc8ce87a26aaeeec655530e2960561498e61c94a (diff)
downloadnextcloud-server-21da6271a8656517e956aa8897d8316b6a61ceac.tar.gz
nextcloud-server-21da6271a8656517e956aa8897d8316b6a61ceac.zip
Parse share owner from Webdav to display in UI
Diffstat (limited to 'apps/files_sharing/js')
-rw-r--r--apps/files_sharing/js/share.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index 63225a0d8ec..3d105f283d8 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -50,7 +50,7 @@
if (fileData.shareOwner) {
tr.attr('data-share-owner', fileData.shareOwner);
// user should always be able to rename a mount point
- if (fileData.isShareMountPoint) {
+ if (fileData.mountType === 'shared-root') {
tr.attr('data-permissions', fileData.permissions | OC.PERMISSION_UPDATE);
}
}
@@ -68,6 +68,26 @@
return fileInfo;
};
+ var NS_OC = 'http://owncloud.org/ns';
+
+ var oldGetWebdavProperties = fileList._getWebdavProperties;
+ fileList._getWebdavProperties = function() {
+ var props = oldGetWebdavProperties.apply(this, arguments);
+ props.push('{' + NS_OC + '}owner-display-name');
+ return props;
+ };
+
+ fileList.filesClient.addFileInfoParser(function(response) {
+ var data = {};
+ var props = response.propStat[0].properties;
+ var permissionsProp = props['{' + NS_OC + '}permissions'];
+
+ if (permissionsProp && permissionsProp.indexOf('S') >= 0) {
+ data.shareOwner = props['{' + NS_OC + '}owner-display-name'];
+ }
+ return data;
+ });
+
// use delegate to catch the case with multiple file lists
fileList.$el.on('fileActionsReady', function(ev){
var fileList = ev.fileList;