diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-11-02 15:27:58 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-11-22 16:05:50 +0100 |
commit | 21da6271a8656517e956aa8897d8316b6a61ceac (patch) | |
tree | f97971fc33b2ad53025debc260d1eaa5701e2494 /apps/files_sharing/js | |
parent | dc8ce87a26aaeeec655530e2960561498e61c94a (diff) | |
download | nextcloud-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.js | 22 |
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; |